Added single column UI layouts
This changes the layout when the properties window gets too narrow to render the contents properly. Currently implemented for render, scene, world, object and materials, but the rest can be done easily. Here's a video for demonstration: http://www.reynish.com/files/blender25/properties_resize.mov It automatically detects the window width and then skips the indicators that tells the layout to go to the next column. It requires very minimal changes to the UI scripts so we don't have to maintain two versions of the layouts.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
def active_node_mat(mat):
|
||||
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
|
||||
@@ -89,6 +90,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
row.itemO("object.material_slot_select", text="Select")
|
||||
row.itemO("object.material_slot_deselect", text="Deselect")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
split = layout.split(percentage=0.65)
|
||||
|
||||
if ob:
|
||||
@@ -101,9 +103,14 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
||||
elif mat:
|
||||
split.template_ID(space, "pin_id")
|
||||
split.itemS()
|
||||
else:
|
||||
layout.template_ID(ob, "active_material", new="material.new")
|
||||
|
||||
if mat:
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(mat, "type", expand=True)
|
||||
else:
|
||||
layout.itemR(mat, "type", text="")
|
||||
|
||||
|
||||
class MATERIAL_PT_shading(MaterialButtonsPanel):
|
||||
@@ -131,6 +138,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
|
||||
sub = col.column()
|
||||
sub.itemR(mat, "translucency")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "shadeless")
|
||||
sub = col.column()
|
||||
@@ -160,17 +168,19 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Size:")
|
||||
col.itemR(tan, "root_size", text="Root")
|
||||
col.itemR(tan, "tip_size", text="Tip")
|
||||
col.itemR(tan, "min_size", text="Minimum")
|
||||
col.itemR(tan, "blender_units")
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Size:")
|
||||
sub.itemR(tan, "root_size", text="Root")
|
||||
sub.itemR(tan, "tip_size", text="Tip")
|
||||
sub.itemR(tan, "min_size", text="Minimum")
|
||||
sub.itemR(tan, "blender_units")
|
||||
sub = col.column()
|
||||
sub.active = (not mat.shadeless)
|
||||
sub.itemR(tan, "tangent_shading")
|
||||
col.itemR(tan, "shape")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Shading:")
|
||||
col.itemR(tan, "width_fade")
|
||||
@@ -204,6 +214,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
|
||||
col.itemR(phys, "friction")
|
||||
col.itemR(phys, "align_to_normal")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(phys, "force", slider=True)
|
||||
col.itemR(phys, "elasticity", slider=True)
|
||||
@@ -242,6 +253,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
|
||||
row.active = mat.light_group
|
||||
row.itemR(mat, "light_group_exclusive", text="Exclusive")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "face_texture")
|
||||
sub = col.column()
|
||||
@@ -277,6 +289,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
|
||||
col.itemR(mat, "cast_shadows_only", text="Cast Only")
|
||||
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "cast_buffer_shadows")
|
||||
sub = col.column()
|
||||
@@ -310,6 +323,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
||||
sub.active = (not mat.shadeless)
|
||||
sub.itemR(mat, "diffuse_intensity", text="Intensity")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.active = (not mat.shadeless)
|
||||
col.itemR(mat, "diffuse_shader", text="")
|
||||
@@ -322,25 +336,37 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
|
||||
elif mat.diffuse_shader == 'MINNAERT':
|
||||
col.itemR(mat, "darkness")
|
||||
elif mat.diffuse_shader == 'TOON':
|
||||
row = col.row()
|
||||
row.itemR(mat, "diffuse_toon_size", text="Size")
|
||||
row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
|
||||
split = col.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_toon_size", text="Size")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_toon_smooth", text="Smooth")
|
||||
elif mat.diffuse_shader == 'FRESNEL':
|
||||
row = col.row()
|
||||
row.itemR(mat, "diffuse_fresnel", text="Fresnel")
|
||||
row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
|
||||
split = col.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_fresnel", text="Fresnel")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_fresnel_factor", text="Factor")
|
||||
|
||||
if mat.use_diffuse_ramp:
|
||||
layout.itemS()
|
||||
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
|
||||
layout.itemS()
|
||||
row = layout.row()
|
||||
split = row.split(percentage=0.3)
|
||||
split.itemL(text="Input:")
|
||||
split.itemR(mat, "diffuse_ramp_input", text="")
|
||||
split = row.split(percentage=0.3)
|
||||
split.itemL(text="Blend:")
|
||||
split.itemR(mat, "diffuse_ramp_blend", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_ramp_input", text="Input")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "diffuse_ramp_blend", text="Blend")
|
||||
row = layout.row()
|
||||
row.itemR(mat, "diffuse_ramp_factor", text="Factor")
|
||||
|
||||
@@ -367,6 +393,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
|
||||
col.itemR(mat, "specular_color", text="")
|
||||
col.itemR(mat, "specular_intensity", text="Intensity")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_shader", text="")
|
||||
col.itemR(mat, "use_specular_ramp", text="Ramp")
|
||||
@@ -375,27 +402,39 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
|
||||
if mat.specular_shader in ('COOKTORR', 'PHONG'):
|
||||
col.itemR(mat, "specular_hardness", text="Hardness")
|
||||
elif mat.specular_shader == 'BLINN':
|
||||
row = col.row()
|
||||
row.itemR(mat, "specular_hardness", text="Hardness")
|
||||
row.itemR(mat, "specular_ior", text="IOR")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_hardness", text="Hardness")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_ior", text="IOR")
|
||||
elif mat.specular_shader == 'WARDISO':
|
||||
col.itemR(mat, "specular_slope", text="Slope")
|
||||
elif mat.specular_shader == 'TOON':
|
||||
row = col.row()
|
||||
row.itemR(mat, "specular_toon_size", text="Size")
|
||||
row.itemR(mat, "specular_toon_smooth", text="Smooth")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_toon_size", text="Size")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_toon_smooth", text="Smooth")
|
||||
|
||||
if mat.use_specular_ramp:
|
||||
layout.itemS()
|
||||
layout.template_color_ramp(mat, "specular_ramp", expand=True)
|
||||
layout.itemS()
|
||||
row = layout.row()
|
||||
split = row.split(percentage=0.3)
|
||||
split.itemL(text="Input:")
|
||||
split.itemR(mat, "specular_ramp_input", text="")
|
||||
split = row.split(percentage=0.3)
|
||||
split.itemL(text="Blend:")
|
||||
split.itemR(mat, "specular_ramp_blend", text="")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_ramp_input", text="Input")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(mat, "specular_ramp_blend", text="Blend")
|
||||
|
||||
row = layout.row()
|
||||
row.itemR(mat, "specular_ramp_factor", text="Factor")
|
||||
|
||||
@@ -434,6 +473,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
|
||||
col.itemR(sss, "color", text="")
|
||||
col.itemR(sss, "radius", text="RGB Radius")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Blend:")
|
||||
@@ -475,6 +515,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
||||
col.itemR(raym, "reflect_factor")
|
||||
col.itemR(mat, "mirror_color", text="")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(raym, "fresnel")
|
||||
sub = col.column()
|
||||
@@ -492,6 +533,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
||||
sub.itemL(text="Fade To:")
|
||||
sub.itemR(raym, "fade_to", text="")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Gloss:")
|
||||
col.itemR(raym, "gloss_factor", text="Amount")
|
||||
@@ -525,7 +567,10 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
|
||||
row = layout.row()
|
||||
row.active = mat.transparency and (not mat.shadeless)
|
||||
if (context.region.width > narrowui):
|
||||
row.itemR(mat, "transparency_method", expand=True)
|
||||
else:
|
||||
row.itemR(mat, "transparency_method", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
@@ -535,6 +580,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
row.active = mat.transparency and (not mat.shadeless)
|
||||
row.itemR(mat, "specular_alpha", text="Specular")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.active = (not mat.shadeless)
|
||||
col.itemR(rayt, "fresnel")
|
||||
@@ -554,6 +600,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
||||
col.itemR(rayt, "limit")
|
||||
col.itemR(rayt, "depth")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Gloss:")
|
||||
col.itemR(rayt, "gloss_factor", text="Amount")
|
||||
@@ -592,6 +639,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
|
||||
col.itemR(halo, "shaded")
|
||||
col.itemR(halo, "soft")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(halo, "ring")
|
||||
sub = col.column()
|
||||
@@ -639,6 +687,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
|
||||
col.itemR(halo, "flare_size", text="Size")
|
||||
col.itemR(halo, "flare_boost", text="Boost")
|
||||
col.itemR(halo, "flare_seed", text="Seed")
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(halo, "flares_sub", text="Subflares")
|
||||
col.itemR(halo, "flare_subsize", text="Subsize")
|
||||
@@ -681,9 +730,12 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
|
||||
vol = context.material.volume # dont use node material
|
||||
|
||||
split = layout.split()
|
||||
row = split.row()
|
||||
row.itemR(vol, "density")
|
||||
row.itemR(vol, "density_scale")
|
||||
col = split.column()
|
||||
col.itemR(vol, "density")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(vol, "density_scale")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
||||
@@ -703,6 +755,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
|
||||
col.itemR(vol, "asymmetry")
|
||||
col.itemR(vol, "transmission_color")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemR(vol, "emission")
|
||||
@@ -727,6 +780,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
|
||||
col = split.column()
|
||||
col.itemR(vol, "lighting_mode", text="")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
|
||||
if vol.lighting_mode == 'SHADED':
|
||||
@@ -757,7 +811,10 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
|
||||
|
||||
mat = context.material # dont use node material
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(mat, "transparency_method", expand=True)
|
||||
else:
|
||||
layout.itemR(mat, "transparency_method", text="")
|
||||
|
||||
|
||||
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
||||
@@ -778,6 +835,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
|
||||
col = col.column(align=True)
|
||||
col.itemR(vol, "step_size")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(vol, "depth_cutoff")
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class ObjectButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@@ -48,6 +49,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
|
||||
|
||||
ob = context.object
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
row = layout.row()
|
||||
|
||||
row.column().itemR(ob, "location")
|
||||
@@ -64,6 +66,17 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
|
||||
row.column().itemR(ob, "scale")
|
||||
|
||||
layout.itemR(ob, "rotation_mode")
|
||||
else:
|
||||
col = layout.column()
|
||||
col.itemR(ob, "location")
|
||||
col.itemR(ob, "rotation_mode", text="")
|
||||
if ob.rotation_mode == 'QUATERNION':
|
||||
col.itemR(ob, "rotation_quaternion")
|
||||
elif ob.rotation_mode == 'AXIS_ANGLE':
|
||||
col.itemR(ob, "rotation_axis_angle", text="Rotation")
|
||||
else:
|
||||
col.itemR(ob, "rotation_euler", text="Rotation")
|
||||
col.itemR(ob, "scale")
|
||||
|
||||
|
||||
class OBJECT_PT_transform_locks(ObjectButtonsPanel):
|
||||
@@ -107,14 +120,13 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
|
||||
col.itemS()
|
||||
col.itemR(ob, "pass_index")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Parent:")
|
||||
col.itemR(ob, "parent", text="")
|
||||
|
||||
sub = col.column()
|
||||
split = sub.split(percentage=0.3)
|
||||
split.itemL(text="Type:")
|
||||
split.itemR(ob, "parent_type", text="")
|
||||
sub.itemR(ob, "parent_type", text="")
|
||||
parent = ob.parent
|
||||
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
||||
sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
|
||||
@@ -129,9 +141,12 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
|
||||
|
||||
ob = context.object
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
split = layout.split()
|
||||
split.item_menu_enumO("object.group_add", "group", text="Add to Group")
|
||||
split.itemL()
|
||||
else:
|
||||
layout.item_menu_enumO("object.group_add", "group", text="Add to Group")
|
||||
|
||||
for group in bpy.data.groups:
|
||||
if ob.name in group.objects:
|
||||
@@ -144,8 +159,13 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
|
||||
row.itemO("object.group_remove", text="", icon='VICON_X')
|
||||
|
||||
split = col.box().split()
|
||||
split.column().itemR(group, "layer", text="Dupli")
|
||||
split.column().itemR(group, "dupli_offset", text="")
|
||||
|
||||
col = split.column()
|
||||
col.itemR(group, "layer", text="Dupli")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(group, "dupli_offset", text="")
|
||||
|
||||
|
||||
class OBJECT_PT_display(ObjectButtonsPanel):
|
||||
@@ -159,6 +179,8 @@ class OBJECT_PT_display(ObjectButtonsPanel):
|
||||
split = layout.split()
|
||||
col = split.column()
|
||||
col.itemR(ob, "max_draw_type", text="Type")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
row.itemR(ob, "draw_bounds", text="Bounds")
|
||||
@@ -166,13 +188,18 @@ class OBJECT_PT_display(ObjectButtonsPanel):
|
||||
sub.active = ob.draw_bounds
|
||||
sub.itemR(ob, "draw_bounds_type", text="")
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(ob, "draw_name", text="Name")
|
||||
flow.itemR(ob, "draw_axis", text="Axis")
|
||||
flow.itemR(ob, "draw_wire", text="Wire")
|
||||
flow.itemR(ob, "draw_texture_space", text="Texture Space")
|
||||
flow.itemR(ob, "x_ray", text="X-Ray")
|
||||
flow.itemR(ob, "draw_transparent", text="Transparency")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(ob, "draw_name", text="Name")
|
||||
col.itemR(ob, "draw_axis", text="Axis")
|
||||
col.itemR(ob, "draw_wire", text="Wire")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(ob, "draw_texture_space", text="Texture Space")
|
||||
col.itemR(ob, "x_ray", text="X-Ray")
|
||||
col.itemR(ob, "draw_transparent", text="Transparency")
|
||||
|
||||
|
||||
class OBJECT_PT_duplication(ObjectButtonsPanel):
|
||||
@@ -183,7 +210,10 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
|
||||
|
||||
ob = context.object
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(ob, "dupli_type", expand=True)
|
||||
else:
|
||||
layout.itemR(ob, "dupli_type", text="")
|
||||
|
||||
if ob.dupli_type == 'FRAMES':
|
||||
split = layout.split()
|
||||
@@ -192,6 +222,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
|
||||
col.itemR(ob, "dupli_frames_start", text="Start")
|
||||
col.itemR(ob, "dupli_frames_end", text="End")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column(align=True)
|
||||
col.itemR(ob, "dupli_frames_on", text="On")
|
||||
col.itemR(ob, "dupli_frames_off", text="Off")
|
||||
@@ -202,12 +233,20 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
|
||||
layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
|
||||
|
||||
elif ob.dupli_type == 'FACES':
|
||||
row = layout.row()
|
||||
row.itemR(ob, "dupli_faces_scale", text="Scale")
|
||||
row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(ob, "dupli_faces_scale", text="Scale")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
|
||||
|
||||
elif ob.dupli_type == 'GROUP':
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(ob, "dupli_group", text="Group")
|
||||
else:
|
||||
layout.itemR(ob, "dupli_group", text="")
|
||||
|
||||
|
||||
class OBJECT_PT_animation(ObjectButtonsPanel):
|
||||
@@ -234,6 +273,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
|
||||
row.active = ob.parent != None
|
||||
col.itemR(ob, "time_offset", text="Offset")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Track:")
|
||||
col.itemR(ob, "track", text="")
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class RenderButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@@ -26,11 +27,14 @@ class RenderButtonsPanel(bpy.types.Panel):
|
||||
bl_context = "render"
|
||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||
|
||||
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render_data
|
||||
return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
|
||||
class RENDER_PT_render(RenderButtonsPanel):
|
||||
bl_label = "Render"
|
||||
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||
@@ -39,10 +43,16 @@ class RENDER_PT_render(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
global narrowui
|
||||
|
||||
row = layout.row()
|
||||
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
|
||||
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
|
||||
|
||||
layout.itemR(rd, "display_mode", text="Display")
|
||||
|
||||
@@ -74,6 +84,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
|
||||
|
||||
col = split.column()
|
||||
col.itemR(scene, "visible_layers", text="Scene")
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rl, "visible_layers", text="Layer")
|
||||
|
||||
@@ -121,6 +132,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
|
||||
col.itemR(rl, "pass_mist")
|
||||
col.itemR(rl, "pass_object_index")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL()
|
||||
col.itemR(rl, "pass_color")
|
||||
@@ -159,6 +171,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
|
||||
col.itemR(rd, "render_sss", text="Subsurface Scattering")
|
||||
col.itemR(rd, "render_envmaps", text="Environment Map")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "render_raytracing", text="Ray Tracing")
|
||||
col.itemR(rd, "color_management")
|
||||
@@ -187,6 +200,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
|
||||
col.itemR(rd, "parts_x", text="X")
|
||||
col.itemR(rd, "parts_y", text="Y")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemL(text="Memory:")
|
||||
sub = col.column()
|
||||
@@ -222,6 +236,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
|
||||
col.itemR(rd, "use_compositing")
|
||||
col.itemR(rd, "use_sequencer")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
|
||||
|
||||
@@ -236,7 +251,11 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
|
||||
sub.row().itemR(rd, "field_order", expand=True)
|
||||
sub.itemR(rd, "fields_still", text="Still")
|
||||
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
else:
|
||||
col.itemS()
|
||||
col.itemR(rd, "edge")
|
||||
sub = col.column()
|
||||
sub.active = rd.edge
|
||||
@@ -253,6 +272,7 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
|
||||
rd = context.scene.render_data
|
||||
|
||||
|
||||
layout.itemR(rd, "output_path", text="")
|
||||
|
||||
split = layout.split()
|
||||
@@ -260,6 +280,7 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
col.itemR(rd, "file_format", text="")
|
||||
col.row().itemR(rd, "color_mode", text="Color", expand=True)
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "file_extensions")
|
||||
col.itemR(rd, "use_overwrite")
|
||||
@@ -276,10 +297,13 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
col.itemL(text="Codec:")
|
||||
col.itemR(rd, "exr_codec", text="")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
subsplit = split.split()
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_half")
|
||||
col.itemR(rd, "exr_zbuf")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = subsplit.column()
|
||||
col.itemR(rd, "exr_preview")
|
||||
|
||||
@@ -289,6 +313,7 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
col.itemL(text="Depth:")
|
||||
col.row().itemR(rd, "jpeg2k_depth", expand=True)
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "jpeg2k_preset", text="")
|
||||
col.itemR(rd, "jpeg2k_ycc")
|
||||
@@ -298,6 +323,7 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
col = split.column()
|
||||
col.itemR(rd, "cineon_log", text="Convert to Log")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column(align=True)
|
||||
col.active = rd.cineon_log
|
||||
col.itemR(rd, "cineon_black", text="Black")
|
||||
@@ -340,6 +366,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
|
||||
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
|
||||
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_gopsize")
|
||||
col.itemR(rd, "ffmpeg_autosplit")
|
||||
@@ -357,6 +384,8 @@ class RENDER_PT_encoding(RenderButtonsPanel):
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_audio_bitrate")
|
||||
col.itemR(rd, "ffmpeg_audio_mixrate")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "ffmpeg_multiplex_audio")
|
||||
col.itemR(rd, "ffmpeg_audio_volume")
|
||||
@@ -375,7 +404,6 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
|
||||
layout = self.layout
|
||||
|
||||
rd = context.scene.render_data
|
||||
|
||||
layout.active = rd.antialiasing
|
||||
|
||||
split = layout.split()
|
||||
@@ -384,6 +412,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
|
||||
col.row().itemR(rd, "antialiasing_samples", expand=True)
|
||||
col.itemR(rd, "full_sample")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(rd, "pixel_filter", text="")
|
||||
col.itemR(rd, "filter_size", text="Size", slider=True)
|
||||
@@ -418,15 +447,18 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
|
||||
rowsub.active = rd.use_border
|
||||
rowsub.itemR(rd, "crop_to_border", text="Crop")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.itemL(text="Frame Range:")
|
||||
col.itemR(scene, "start_frame", text="Start")
|
||||
col.itemR(scene, "end_frame", text="End")
|
||||
col.itemR(scene, "frame_step", text="Step")
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Frame Range:")
|
||||
sub.itemR(scene, "start_frame", text="Start")
|
||||
sub.itemR(scene, "end_frame", text="End")
|
||||
sub.itemR(scene, "frame_step", text="Step")
|
||||
|
||||
col.itemL(text="Frame Rate:")
|
||||
col.itemR(rd, "fps")
|
||||
col.itemR(rd, "fps_base", text="/")
|
||||
sub = col.column(align=True)
|
||||
sub.itemL(text="Frame Rate:")
|
||||
sub.itemR(rd, "fps")
|
||||
sub.itemR(rd, "fps_base", text="/")
|
||||
|
||||
|
||||
class RENDER_PT_stamp(RenderButtonsPanel):
|
||||
@@ -459,6 +491,7 @@ class RENDER_PT_stamp(RenderButtonsPanel):
|
||||
col.itemR(rd, "stamp_marker", text="Marker")
|
||||
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.active = rd.render_stamp
|
||||
col.itemR(rd, "stamp_foreground", slider=True)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class SceneButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@@ -38,8 +39,12 @@ class SCENE_PT_scene(SceneButtonsPanel):
|
||||
|
||||
scene = context.scene
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(scene, "camera")
|
||||
layout.itemR(scene, "set", text="Background")
|
||||
else:
|
||||
layout.itemR(scene, "camera", text="")
|
||||
layout.itemR(scene, "set", text="")
|
||||
|
||||
|
||||
class SCENE_PT_unit(SceneButtonsPanel):
|
||||
@@ -54,10 +59,15 @@ class SCENE_PT_unit(SceneButtonsPanel):
|
||||
col = layout.column()
|
||||
col.row().itemR(unit, "system", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = (unit.system != 'NONE')
|
||||
row.itemR(unit, "scale_length", text="Scale")
|
||||
row.itemR(unit, "use_separate")
|
||||
split = layout.split()
|
||||
split.active = (unit.system != 'NONE')
|
||||
|
||||
col = split.column()
|
||||
col.itemR(unit, "scale_length", text="Scale")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(unit, "use_separate")
|
||||
|
||||
|
||||
class SCENE_PT_keying_sets(SceneButtonsPanel):
|
||||
@@ -85,6 +95,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
|
||||
col.itemR(ks, "name")
|
||||
col.itemR(ks, "absolute")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = row.column()
|
||||
col.itemL(text="Keyframing Settings:")
|
||||
col.itemR(ks, "insertkey_needed", text="Needed")
|
||||
@@ -131,6 +142,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
|
||||
if ksp.entire_array == False:
|
||||
col.itemR(ksp, "array_index")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = row.column()
|
||||
col.itemL(text="F-Curve Grouping:")
|
||||
col.itemR(ksp, "grouping")
|
||||
@@ -152,7 +164,10 @@ class SCENE_PT_physics(SceneButtonsPanel):
|
||||
|
||||
layout.active = scene.use_gravity
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
layout.itemR(scene, "gravity", text="")
|
||||
else:
|
||||
layout.column().itemR(scene, "gravity", text="")
|
||||
|
||||
bpy.types.register(SCENE_PT_scene)
|
||||
bpy.types.register(SCENE_PT_unit)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
|
||||
class WorldButtonsPanel(bpy.types.Panel):
|
||||
bl_space_type = 'PROPERTIES'
|
||||
@@ -72,10 +73,16 @@ class WORLD_PT_world(WorldButtonsPanel):
|
||||
|
||||
world = context.world
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
row = layout.row()
|
||||
row.itemR(world, "paper_sky")
|
||||
row.itemR(world, "blend_sky")
|
||||
row.itemR(world, "real_sky")
|
||||
else:
|
||||
col = layout.column()
|
||||
col.itemR(world, "paper_sky")
|
||||
col.itemR(world, "blend_sky")
|
||||
col.itemR(world, "real_sky")
|
||||
|
||||
row = layout.row()
|
||||
row.column().itemR(world, "horizon_color")
|
||||
@@ -101,11 +108,16 @@ class WORLD_PT_mist(WorldButtonsPanel):
|
||||
|
||||
layout.active = world.mist.enabled
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.mist, "intensity", slider=True)
|
||||
flow.itemR(world.mist, "start")
|
||||
flow.itemR(world.mist, "depth")
|
||||
flow.itemR(world.mist, "height")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(world.mist, "intensity", slider=True)
|
||||
col.itemR(world.mist, "start")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(world.mist, "depth")
|
||||
col.itemR(world.mist, "height")
|
||||
|
||||
layout.itemR(world.mist, "falloff")
|
||||
|
||||
@@ -126,11 +138,16 @@ class WORLD_PT_stars(WorldButtonsPanel):
|
||||
|
||||
layout.active = world.stars.enabled
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.itemR(world.stars, "size")
|
||||
flow.itemR(world.stars, "color_randomization", text="Colors")
|
||||
flow.itemR(world.stars, "min_distance", text="Min. Dist")
|
||||
flow.itemR(world.stars, "average_separation", text="Separation")
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.itemR(world.stars, "size")
|
||||
col.itemR(world.stars, "color_randomization", text="Colors")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
col.itemR(world.stars, "min_distance", text="Min. Dist")
|
||||
col.itemR(world.stars, "average_separation", text="Separation")
|
||||
|
||||
|
||||
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
@@ -163,6 +180,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
sub.itemR(ao, "falloff_strength", text="Strength")
|
||||
|
||||
if ao.gather_method == 'RAYTRACE':
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
@@ -178,6 +196,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
sub.itemR(ao, "bias")
|
||||
|
||||
if ao.gather_method == 'APPROXIMATE':
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
|
||||
col.itemL(text="Sampling:")
|
||||
@@ -196,10 +215,9 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
|
||||
col = split.column()
|
||||
col.itemR(ao, "energy")
|
||||
|
||||
if (context.region.width > narrowui):
|
||||
col = split.column()
|
||||
sub = col.split(percentage=0.3)
|
||||
sub.itemL(text="Color:")
|
||||
sub.itemR(ao, "color", text="")
|
||||
col.itemR(ao, "color")
|
||||
|
||||
bpy.types.register(WORLD_PT_context_world)
|
||||
bpy.types.register(WORLD_PT_preview)
|
||||
|
||||
@@ -1424,21 +1424,22 @@ static void rna_def_userdef_themes(BlenderRNA *brna)
|
||||
|
||||
static EnumPropertyItem active_theme_group[] = {
|
||||
{0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
|
||||
{1, "VIEW_3D", ICON_VIEW3D, "View 3D", ""},
|
||||
{2, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
|
||||
{3, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
|
||||
{4, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
|
||||
{5, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet Editor", ""},
|
||||
{6, "IMAGE_EDITOR", ICON_IMAGE_COL, "Image Editor", ""},
|
||||
{7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Sequence Editor", ""},
|
||||
{8, "PROPERTIES", ICON_BUTS, "Properties", ""},
|
||||
{9, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
|
||||
{10, "TIMELINE", ICON_TIME, "Timeline", ""},
|
||||
{11, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
|
||||
{12, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
|
||||
{13, "OUTLINER", ICON_OOPS, "Outliner", ""},
|
||||
{14, "INFO", ICON_INFO, "Info", ""},
|
||||
{15, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
|
||||
{1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
|
||||
{2, "TIMELINE", ICON_TIME, "Timeline", ""},
|
||||
{3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
|
||||
{4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
|
||||
{5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
|
||||
{6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
|
||||
{7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
|
||||
{8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
|
||||
{9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
|
||||
{10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
|
||||
{11, "PROPERTIES", ICON_BUTS, "Properties", ""},
|
||||
{12, "OUTLINER", ICON_OOPS, "Outliner", ""},
|
||||
{14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
|
||||
{15, "INFO", ICON_INFO, "Info", ""},
|
||||
{16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
|
||||
{17, "CONSOLE", ICON_CONSOLE, "Console", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
srna= RNA_def_struct(brna, "Theme", NULL);
|
||||
|
||||
Reference in New Issue
Block a user