Also fixed a few minor layout issues.
# <pep8 compliant>
import bpy
+narrowui = 180
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
ob = context.object
arm = context.armature
space = context.space_data
-
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif arm:
- split.template_ID(space, "pin_id")
- split.itemS()
+ col2 = context.region.width > narrowui
+
+ if col2:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.itemS()
+ elif arm:
+ split.template_ID(space, "pin_id")
+ split.itemS()
+ else:
+ layout.template_ID(ob, "data")
class DATA_PT_skeleton(DataButtonsPanel):
ob = context.object
arm = context.armature
space = context.space_data
+ col2 = context.region.width > narrowui
layout.itemR(arm, "pose_position", expand=True)
col.itemL(text="Protected Layers:")
col.itemR(arm, "layer_protection", text="")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
layout = self.layout
arm = context.armature
+ col2 = context.region.width > narrowui
- layout.row().itemR(arm, "drawtype", expand=True)
+ if col2:
+ layout.row().itemR(arm, "drawtype", expand=True)
+ else:
+ layout.row().itemR(arm, "drawtype", text="")
- flow = layout.column_flow()
- flow.itemR(arm, "draw_names", text="Names")
- flow.itemR(arm, "draw_axes", text="Axes")
- flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
- flow.itemR(arm, "draw_group_colors", text="Colors")
- flow.itemR(arm, "delay_deform", text="Delay Refresh")
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(arm, "draw_names", text="Names")
+ col.itemR(arm, "draw_axes", text="Axes")
+ col.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
+
+ if col2:
+ col = split.column()
+ col.itemR(arm, "draw_group_colors", text="Colors")
+ col.itemR(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
ob = context.object
pose = ob.pose
+ col2 = context.region.width > narrowui
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
col.active = (ob.proxy == None)
col.itemR(group, "name")
- split = layout.split(0.5)
+ split = layout.split()
split.active = (ob.proxy == None)
- split.itemR(group, "color_set")
+
+ col = split.column()
+ col.itemR(group, "color_set")
if group.color_set:
- split.template_triColorSet(group, "colors")
+ if col2:
+ col = split.column()
+ col.template_triColorSet(group, "colors")
row = layout.row(align=True)
row.active = (ob.proxy == None)
layout = self.layout
arm = context.armature
+ col2 = context.region.width > narrowui
- layout.itemR(arm, "paths_type", expand=True)
+ if col2:
+ layout.itemR(arm, "paths_type", expand=True)
+ else:
+ layout.itemR(arm, "paths_type", text="")
split = layout.split()
sub.itemR(arm, "path_size", text="Step")
col.row().itemR(arm, "paths_location", expand=True)
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
layout.itemS()
- row = layout.row()
- row.itemO("pose.paths_calculate", text="Calculate Paths")
- row.itemO("pose.paths_clear", text="Clear Paths")
+ split = layout.split()
+
+ col = split.column()
+ col.itemO("pose.paths_calculate", text="Calculate Paths")
+
+ if col2:
+ col = split.column()
+ col.itemO("pose.paths_clear", text="Clear Paths")
class DATA_PT_ghost(DataButtonsPanel):
layout = self.layout
arm = context.armature
+ col2 = context.region.width > narrowui
- layout.itemR(arm, "ghost_type", expand=True)
+ if col2:
+ layout.itemR(arm, "ghost_type", expand=True)
+ else:
+ layout.itemR(arm, "ghost_type", text="")
split = layout.split()
sub.itemR(arm, "ghost_step", text="Range")
sub.itemR(arm, "ghost_size", text="Step")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "ghost_only_selected", text="Selected Only")
# <pep8 compliant>
import bpy
+narrowui = 180
class BoneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
ob = context.object
bone = context.bone
+ col2 = context.region.width > narrowui
+
if not bone:
bone = context.edit_bone
-
- row = layout.row()
- row.column().itemR(bone, "head")
- row.column().itemR(bone, "tail")
-
- col = row.column()
- sub = col.column(align=True)
- sub.itemL(text="Roll:")
- sub.itemR(bone, "roll", text="")
- sub.itemL()
- sub.itemR(bone, "locked")
+ if col2:
+ row = layout.row()
+ row.column().itemR(bone, "head")
+ row.column().itemR(bone, "tail")
+
+ col = row.column()
+ sub = col.column(align=True)
+ sub.itemL(text="Roll:")
+ sub.itemR(bone, "roll", text="")
+ sub.itemL()
+ sub.itemR(bone, "locked")
+ else:
+ col = layout.column()
+ col.itemR(bone, "head")
+ col.itemR(bone, "tail")
+ col.itemR(bone, "roll")
+ col.itemR(bone, "locked")
else:
pchan = ob.pose.pose_channels[context.bone.name]
-
- row = layout.row()
- col = row.column()
- col.itemR(pchan, "location")
- col.active = not (bone.parent and bone.connected)
-
- col = row.column()
- if pchan.rotation_mode == 'QUATERNION':
- col.itemR(pchan, "rotation_quaternion", text="Rotation")
- elif pchan.rotation_mode == 'AXIS_ANGLE':
- #col.itemL(text="Rotation")
- #col.itemR(pchan, "rotation_angle", text="Angle")
- #col.itemR(pchan, "rotation_axis", text="Axis")
- col.itemR(pchan, "rotation_axis_angle", text="Rotation")
+
+ if col2:
+ row = layout.row()
+ col = row.column()
+ col.itemR(pchan, "location")
+ col.active = not (bone.parent and bone.connected)
+
+ col = row.column()
+ if pchan.rotation_mode == 'QUATERNION':
+ col.itemR(pchan, "rotation_quaternion", text="Rotation")
+ elif pchan.rotation_mode == 'AXIS_ANGLE':
+ #col.itemL(text="Rotation")
+ #col.itemR(pchan, "rotation_angle", text="Angle")
+ #col.itemR(pchan, "rotation_axis", text="Axis")
+ col.itemR(pchan, "rotation_axis_angle", text="Rotation")
+ else:
+ col.itemR(pchan, "rotation_euler", text="Rotation")
+
+ row.column().itemR(pchan, "scale")
+
+ layout.itemR(pchan, "rotation_mode")
else:
- col.itemR(pchan, "rotation_euler", text="Rotation")
-
- row.column().itemR(pchan, "scale")
-
- layout.itemR(pchan, "rotation_mode")
+ col = layout.column()
+ sub = col.column()
+ sub.active = not (bone.parent and bone.connected)
+ sub.itemR(pchan, "location")
+ col.itemL(text="Rotation:")
+ col.itemR(pchan, "rotation_mode", text="")
+ if pchan.rotation_mode == 'QUATERNION':
+ col.itemR(pchan, "rotation_quaternion", text="")
+ elif pchan.rotation_mode == 'AXIS_ANGLE':
+ col.itemR(pchan, "rotation_axis_angle", text="")
+ else:
+ col.itemR(pchan, "rotation_euler", text="")
+ col.itemR(pchan, "scale")
class BONE_PT_transform_locks(BoneButtonsPanel):
ob = context.object
bone = context.bone
arm = context.armature
+ col2 = context.region.width > narrowui
if not bone:
bone = context.edit_bone
col.itemL(text="Bone Group:")
col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Parent:")
if context.bone:
col.itemR(bone, "parent", text="")
ob = context.object
bone = context.bone
arm = context.armature
+ col2 = context.region.width > narrowui
if not bone:
bone = context.edit_bone
split = layout.split()
col = split.column()
-
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
- col = split.column()
-
+ if col2:
+ col = split.column()
col.itemL(text="Custom Shape:")
col.itemR(pchan, "custom_shape", text="")
layout = self.layout
bone = context.bone
+ col2 = context.region.width > narrowui
if not bone:
bone = context.edit_bone
sub.itemR(bone, "head_radius", text="Head")
sub.itemR(bone, "tail_radius", text="Tail")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Curved Bones:")
sub = col.column(align=True)
# <pep8 compliant>
import bpy
+narrowui = 180
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
ob = context.object
cam = context.camera
space = context.space_data
+ col2 = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif cam:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if col2:
+ split = layout.split(percentage=0.65)
+
+ if ob:
+ split.template_ID(ob, "data")
+ split.itemS()
+ elif cam:
+ split.template_ID(space, "pin_id")
+ split.itemS()
+ else:
+ layout.template_ID(ob, "data")
class DATA_PT_camera(DataButtonsPanel):
layout = self.layout
cam = context.camera
+ col2 = context.region.width > narrowui
- layout.itemR(cam, "type", expand=True)
+ if col2:
+ layout.itemR(cam, "type", expand=True)
+ else:
+ layout.itemR(cam, "type", text="")
- row = layout.row()
+ split = layout.split()
+
+ col = split.column()
if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS':
- row.itemR(cam, "lens", text="Angle")
+ col.itemR(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES':
- row.itemR(cam, "angle")
- row.itemR(cam, "lens_unit", text="")
+ col.itemR(cam, "angle")
+ if col2:
+ col = split.column()
+ col.itemR(cam, "lens_unit", text="")
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
col.itemR(cam, "shift_x", text="X")
col.itemR(cam, "shift_y", text="Y")
- col = split.column(align=True)
+ if col2:
+ col = split.column(align=True)
col.itemL(text="Clipping:")
col.itemR(cam, "clip_start", text="Start")
col.itemR(cam, "clip_end", text="End")
layout.itemL(text="Depth of Field:")
- row = layout.row()
- row.itemR(cam, "dof_object", text="")
- row.itemR(cam, "dof_distance", text="Distance")
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(cam, "dof_object", text="")
+
+ if col2:
+ col = split.column()
+ col.itemR(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
layout = self.layout
cam = context.camera
+ col2 = context.region.width > narrowui
split = layout.split()
col.itemR(cam, "show_title_safe", text="Title Safe")
col.itemR(cam, "show_name", text="Name")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemR(cam, "draw_size", text="Size")
col.itemS()
col.itemR(cam, "show_passepartout", text="Passepartout")
# <pep8 compliant>
import bpy
+narrowui = 180
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
ob = context.object
lamp = context.lamp
space = context.space_data
+ col2 = context.region.width > narrowui
- split = layout.split(percentage=0.65)
- if ob:
- split.template_ID(ob, "data")
- split.itemS()
- elif lamp:
- split.template_ID(space, "pin_id")
- split.itemS()
+ if col2:
+ split = layout.split(percentage=0.65)
+ if ob:
+ split.template_ID(ob, "data")
+ split.itemS()
+ elif lamp:
+ split.template_ID(space, "pin_id")
+ split.itemS()
+ else:
+ layout.template_ID(ob, "data")
class DATA_PT_lamp(DataButtonsPanel):
layout = self.layout
lamp = context.lamp
+ col2 = context.region.width > narrowui
- layout.itemR(lamp, "type", expand=True)
+ if col2:
+ layout.itemR(lamp, "type", expand=True)
+ else:
+ layout.itemR(lamp, "type", text="")
split = layout.split()
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
col.itemR(lamp, "specular")
layout = self.layout
lamp = context.lamp.sky
+ col2 = context.region.width > narrowui
layout.itemR(lamp, "sky")
sub.row().itemR(lamp, "sky_color_space", expand=True)
sub.itemR(lamp, "sky_exposure", text="Exposure")
- col = split.column()
+ if col2:
+ col = split.column()
col.active = lamp.sky
col.itemL(text="Horizon:")
sub = col.column()
col.itemR(lamp, "sun_intensity", text="Sun")
col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
- col = split.column()
+ if col2:
+ col = split.column()
col.active = lamp.atmosphere
col.itemL(text="Scattering:")
sub = col.column(align=True)
layout = self.layout
lamp = context.lamp
+ col2 = context.region.width > narrowui
- layout.itemR(lamp, "shadow_method", expand=True)
+ if col2:
+ layout.itemR(lamp, "shadow_method", expand=True)
+ else:
+ layout.itemR(lamp, "shadow_method", text="")
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_color", text="")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemR(lamp, "shadow_layer", text="This Layer Only")
col.itemR(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
col = layout.column()
col.itemL(text="Sampling:")
- col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
+ if col2:
+ col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
+ else:
+ col.itemR(lamp, "shadow_ray_sampling_method", text="")
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
col.itemR(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
- col = split.column()
+ if col2:
+ col = split.column()
elif lamp.type == 'AREA':
split = layout.split()
col = split.column()
- sub = split.column(align=True)
+
if lamp.shape == 'SQUARE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
+ if col2:
+ col = split.column()
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
- sub.itemR(lamp, "umbra")
- sub.itemR(lamp, "dither")
- sub.itemR(lamp, "jitter")
+ if col2:
+ col = split.column()
+ col.itemR(lamp, "umbra")
+ col.itemR(lamp, "dither")
+ col.itemR(lamp, "jitter")
+ else:
+ if col2:
+ col = split.column()
+
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
col.itemL(text="Buffer Type:")
- col.row().itemR(lamp, "shadow_buffer_type", expand=True)
+ if col2:
+ col.row().itemR(lamp, "shadow_buffer_type", expand=True)
+ else:
+ col.row().itemR(lamp, "shadow_buffer_type", text="")
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
split = layout.split()
sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
- col = split.column()
+ if col2:
+ col = split.column()
col.itemL(text="Sample Buffers:")
col.itemR(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True)
elif lamp.shadow_buffer_type == 'IRREGULAR':
layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
- row = layout.row()
- row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
- sub = row.row()
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(lamp, "auto_clip_start", text="Autoclip Start")
+ sub = col.column()
sub.active = not lamp.auto_clip_start
sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
- row = layout.row()
- row.itemR(lamp, "auto_clip_end", text="Autoclip End")
- sub = row.row()
+ if col2:
+ col = split.column()
+ col.itemR(lamp, "auto_clip_end", text="Autoclip End")
+ sub = col.column()
sub.active = not lamp.auto_clip_end
sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
layout = self.layout
lamp = context.lamp
+ col2 = context.region.width > narrowui
split = layout.split()
sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
col.itemR(lamp, "square")
- col = split.column()
+ if col2:
+ col = split.column()
+ else:
+ col.itemS()
col.itemR(lamp, "halo")
sub = col.column(align=True)
sub.active = lamp.halo
else:
col = layout.column()
col.itemR(ob, "location")
+ col.itemL(text="Rotation:")
col.itemR(ob, "rotation_mode", text="")
if ob.rotation_mode == 'QUATERNION':
- col.itemR(ob, "rotation_quaternion")
+ col.itemR(ob, "rotation_quaternion", text="")
elif ob.rotation_mode == 'AXIS_ANGLE':
- col.itemR(ob, "rotation_axis_angle", text="Rotation")
+ col.itemR(ob, "rotation_axis_angle", text="")
else:
- col.itemR(ob, "rotation_euler", text="Rotation")
+ col.itemR(ob, "rotation_euler", text="")
col.itemR(ob, "scale")
scene = context.scene
world = context.world
space = context.space_data
+ col2 = context.region.width > narrowui
- split = layout.split(percentage=0.65)
-
- if scene:
- split.template_ID(scene, "world", new="world.new")
- elif world:
- split.template_ID(space, "pin_id")
-
+
+ if col2:
+ split = layout.split(percentage=0.65)
+ if scene:
+ split.template_ID(scene, "world", new="world.new")
+ elif world:
+ split.template_ID(space, "pin_id")
+ else:
+ layout.template_ID(scene, "world", new="world.new")
class WORLD_PT_world(WorldButtonsPanel):
bl_label = "World"