remove narrow ui feature

- re-arranged UI in a way that gave far too much vert scrolling.
- was added all over for simple things like making text="", layout engine should handle this.
- Ton and Brecht are ok with removing this now. Ton would like to work on the layout engine to make it better support these cases.
This commit is contained in:
Campbell Barton 2010-08-06 15:17:44 +00:00
parent 17bd603cbc
commit acca04bf33
33 changed files with 652 additions and 1516 deletions

@ -19,9 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
################################################
# Generic Panels (Independent of DataType) # Generic Panels (Independent of DataType)
@ -31,15 +29,12 @@ class MotionPathButtonsPanel():
bl_label = "Motion Paths" bl_label = "Motion Paths"
bl_default_closed = True bl_default_closed = True
def draw_settings(self, context, avs, wide_ui, bones=False): def draw_settings(self, context, avs, bones=False):
layout = self.layout layout = self.layout
mps = avs.motion_paths mps = avs.motion_paths
if wide_ui: layout.prop(mps, "type", expand=True)
layout.prop(mps, "type", expand=True)
else:
layout.prop(mps, "type", text="")
split = layout.split() split = layout.split()
@ -56,8 +51,7 @@ class MotionPathButtonsPanel():
if bones: if bones:
col.row().prop(mps, "bake_location", expand=True) col.row().prop(mps, "bake_location", expand=True)
if wide_ui: col = split.column()
col = split.column()
col.label(text="Display:") col.label(text="Display:")
col.prop(mps, "show_frame_numbers", text="Frame Numbers") col.prop(mps, "show_frame_numbers", text="Frame Numbers")
col.prop(mps, "highlight_keyframes", text="Keyframes") col.prop(mps, "highlight_keyframes", text="Keyframes")
@ -77,12 +71,8 @@ class OnionSkinButtonsPanel():
layout = self.layout layout = self.layout
arm = context.armature arm = context.armature
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(arm, "ghost_type", expand=True)
layout.prop(arm, "ghost_type", expand=True)
else:
layout.prop(arm, "ghost_type", text="")
split = layout.split() split = layout.split()
@ -97,8 +87,7 @@ class OnionSkinButtonsPanel():
sub.prop(arm, "ghost_step", text="Range") sub.prop(arm, "ghost_step", text="Range")
sub.prop(arm, "ghost_size", text="Step") sub.prop(arm, "ghost_size", text="Step")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Display:") col.label(text="Display:")
col.prop(arm, "ghost_only_selected", text="Selected Only") col.prop(arm, "ghost_only_selected", text="Selected Only")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -43,18 +41,14 @@ class DATA_PT_context_arm(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
arm = context.armature arm = context.armature
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif arm:
elif arm: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
layout.template_ID(ob, "data")
class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_arm(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -68,12 +62,8 @@ class DATA_PT_skeleton(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
arm = context.armature arm = context.armature
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(arm, "pose_position", expand=True)
layout.prop(arm, "pose_position", expand=True)
else:
layout.prop(arm, "pose_position", text="")
split = layout.split() split = layout.split()
@ -91,8 +81,7 @@ class DATA_PT_skeleton(DataButtonsPanel, bpy.types.Panel):
col.prop(arm, "deform_vertexgroups", text="Vertex Groups") col.prop(arm, "deform_vertexgroups", text="Vertex Groups")
col.prop(arm, "deform_envelope", text="Envelopes") col.prop(arm, "deform_envelope", text="Envelopes")
if wide_ui: col = split.column()
col = split.column()
col.prop(arm, "deform_quaternion", text="Quaternion") col.prop(arm, "deform_quaternion", text="Quaternion")
@ -104,12 +93,8 @@ class DATA_PT_display(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
arm = context.armature arm = context.armature
wide_ui = context.region.width > narrowui
if wide_ui: layout.row().prop(arm, "drawtype", expand=True)
layout.row().prop(arm, "drawtype", expand=True)
else:
layout.row().prop(arm, "drawtype", text="")
split = layout.split() split = layout.split()
@ -118,8 +103,7 @@ class DATA_PT_display(DataButtonsPanel, bpy.types.Panel):
col.prop(arm, "draw_axes", text="Axes") col.prop(arm, "draw_axes", text="Axes")
col.prop(arm, "draw_custom_bone_shapes", text="Shapes") col.prop(arm, "draw_custom_bone_shapes", text="Shapes")
if wide_ui: col = split.column()
col = split.column()
col.prop(arm, "draw_group_colors", text="Colors") col.prop(arm, "draw_group_colors", text="Colors")
col.prop(ob, "x_ray", text="X-Ray") col.prop(ob, "x_ray", text="X-Ray")
col.prop(arm, "delay_deform", text="Delay Refresh") col.prop(arm, "delay_deform", text="Delay Refresh")
@ -137,7 +121,6 @@ class DATA_PT_bone_groups(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
pose = ob.pose pose = ob.pose
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2) row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
@ -159,8 +142,7 @@ class DATA_PT_bone_groups(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(group, "color_set") col.prop(group, "color_set")
if group.color_set: if group.color_set:
if wide_ui: col = split.column()
col = split.column()
col.template_triColorSet(group, "colors") col.template_triColorSet(group, "colors")
row = layout.row() row = layout.row()
@ -183,12 +165,8 @@ class DATA_PT_ghost(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
arm = context.armature arm = context.armature
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(arm, "ghost_type", expand=True)
layout.prop(arm, "ghost_type", expand=True)
else:
layout.prop(arm, "ghost_type", text="")
split = layout.split() split = layout.split()
@ -203,8 +181,7 @@ class DATA_PT_ghost(DataButtonsPanel, bpy.types.Panel):
sub.prop(arm, "ghost_step", text="Range") sub.prop(arm, "ghost_step", text="Range")
sub.prop(arm, "ghost_size", text="Step") sub.prop(arm, "ghost_size", text="Step")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Display:") col.label(text="Display:")
col.prop(arm, "ghost_only_selected", text="Selected Only") col.prop(arm, "ghost_only_selected", text="Selected Only")
@ -224,7 +201,6 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
itasc = ob.pose.ik_param itasc = ob.pose.ik_param
wide_ui = (context.region.width > narrowui)
row = layout.row() row = layout.row()
row.prop(ob.pose, "ik_solver") row.prop(ob.pose, "ik_solver")
@ -241,8 +217,7 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(itasc, "precision") col.prop(itasc, "precision")
if wide_ui: col = split.column()
col = split.column()
col.prop(itasc, "num_iter") col.prop(itasc, "num_iter")
@ -279,9 +254,8 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True) self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
layout.separator() layout.separator()
@ -290,8 +264,7 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.operator("pose.paths_calculate", text="Calculate Paths") col.operator("pose.paths_calculate", text="Calculate Paths")
if wide_ui: col = split.column()
col = split.column()
col.operator("pose.paths_clear", text="Clear Paths") col.operator("pose.paths_clear", text="Clear Paths")
@ -308,9 +281,8 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inhe
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True) self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
def register(): def register():
pass pass

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PoseTemplateSettings(bpy.types.IDPropertyGroup): class PoseTemplateSettings(bpy.types.IDPropertyGroup):
pass pass

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class BoneButtonsPanel(): class BoneButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -68,65 +66,42 @@ class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
wide_ui = context.region.width > narrowui
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
if wide_ui: row = layout.row()
row = layout.row() row.column().prop(bone, "head")
row.column().prop(bone, "head") row.column().prop(bone, "tail")
row.column().prop(bone, "tail")
col = row.column() col = row.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.label(text="Roll:") sub.label(text="Roll:")
sub.prop(bone, "roll", text="") sub.prop(bone, "roll", text="")
sub.label() sub.label()
sub.prop(bone, "lock") sub.prop(bone, "lock")
else:
col = layout.column()
col.prop(bone, "head")
col.prop(bone, "tail")
col.prop(bone, "roll")
col.prop(bone, "lock")
else: else:
pchan = ob.pose.bones[context.bone.name] pchan = ob.pose.bones[context.bone.name]
if wide_ui: row = layout.row()
row = layout.row() col = row.column()
col = row.column() col.prop(pchan, "location")
col.prop(pchan, "location") col.active = not (bone.parent and bone.connected)
col.active = not (bone.parent and bone.connected)
col = row.column() col = row.column()
if pchan.rotation_mode == 'QUATERNION': if pchan.rotation_mode == 'QUATERNION':
col.prop(pchan, "rotation_quaternion", text="Rotation") col.prop(pchan, "rotation_quaternion", text="Rotation")
elif pchan.rotation_mode == 'AXIS_ANGLE': elif pchan.rotation_mode == 'AXIS_ANGLE':
#col.label(text="Rotation") #col.label(text="Rotation")
#col.prop(pchan, "rotation_angle", text="Angle") #col.prop(pchan, "rotation_angle", text="Angle")
#col.prop(pchan, "rotation_axis", text="Axis") #col.prop(pchan, "rotation_axis", text="Axis")
col.prop(pchan, "rotation_axis_angle", text="Rotation") col.prop(pchan, "rotation_axis_angle", text="Rotation")
else:
col.prop(pchan, "rotation_euler", text="Rotation")
row.column().prop(pchan, "scale")
layout.prop(pchan, "rotation_mode")
else: else:
col = layout.column() col.prop(pchan, "rotation_euler", text="Rotation")
sub = col.column()
sub.active = not (bone.parent and bone.connected) row.column().prop(pchan, "scale")
sub.prop(pchan, "location")
col.label(text="Rotation:") layout.prop(pchan, "rotation_mode")
col.prop(pchan, "rotation_mode", text="")
if pchan.rotation_mode == 'QUATERNION':
col.prop(pchan, "rotation_quaternion", text="")
elif pchan.rotation_mode == 'AXIS_ANGLE':
col.prop(pchan, "rotation_axis_angle", text="")
else:
col.prop(pchan, "rotation_euler", text="")
col.prop(pchan, "scale")
class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel): class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel):
@ -170,7 +145,6 @@ class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
arm = context.armature arm = context.armature
wide_ui = context.region.width > narrowui
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
@ -190,8 +164,7 @@ class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel):
col.label(text="Bone Group:") col.label(text="Bone Group:")
col.prop_object(pchan, "bone_group", ob.pose, "bone_groups", text="") col.prop_object(pchan, "bone_group", ob.pose, "bone_groups", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Parent:") col.label(text="Parent:")
if context.bone: if context.bone:
col.prop(bone, "parent", text="") col.prop(bone, "parent", text="")
@ -220,7 +193,6 @@ class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
wide_ui = context.region.width > narrowui
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
@ -236,8 +208,7 @@ class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel):
col.prop(bone, "draw_wire", text="Wireframe") col.prop(bone, "draw_wire", text="Wireframe")
col.prop(bone, "hide", text="Hide") col.prop(bone, "hide", text="Hide")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Custom Shape:") col.label(text="Custom Shape:")
col.prop(pchan, "custom_shape", text="") col.prop(pchan, "custom_shape", text="")
@ -259,7 +230,6 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
pchan = ob.pose.bones[bone.name] pchan = ob.pose.bones[bone.name]
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.prop(ob.pose, "ik_solver") row.prop(ob.pose, "ik_solver")
@ -271,15 +241,12 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True) row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.ik_dof_x and pchan.has_ik row.active = pchan.ik_dof_x and pchan.has_ik
if wide_ui: split = layout.split(percentage=0.25)
split = layout.split(percentage=0.25) sub = split.row()
sub = split.row()
else:
sub = layout.column(align=True)
sub.prop(pchan, "ik_limit_x", text="Limit") sub.prop(pchan, "ik_limit_x", text="Limit")
sub.active = pchan.ik_dof_x and pchan.has_ik sub.active = pchan.ik_dof_x and pchan.has_ik
if wide_ui: sub = split.row(align=True)
sub = split.row(align=True)
sub.prop(pchan, "ik_min_x", text="") sub.prop(pchan, "ik_min_x", text="")
sub.prop(pchan, "ik_max_x", text="") sub.prop(pchan, "ik_max_x", text="")
sub.active = pchan.ik_dof_x and pchan.ik_limit_x and pchan.has_ik sub.active = pchan.ik_dof_x and pchan.ik_limit_x and pchan.has_ik
@ -291,15 +258,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True) row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.ik_dof_y and pchan.has_ik row.active = pchan.ik_dof_y and pchan.has_ik
if wide_ui: split = layout.split(percentage=0.25)
split = layout.split(percentage=0.25) sub = split.row()
sub = split.row()
else:
sub = layout.column(align=True)
sub.prop(pchan, "ik_limit_y", text="Limit") sub.prop(pchan, "ik_limit_y", text="Limit")
sub.active = pchan.ik_dof_y and pchan.has_ik sub.active = pchan.ik_dof_y and pchan.has_ik
if wide_ui:
sub = split.row(align=True) sub = split.row(align=True)
sub.prop(pchan, "ik_min_y", text="") sub.prop(pchan, "ik_min_y", text="")
sub.prop(pchan, "ik_max_y", text="") sub.prop(pchan, "ik_max_y", text="")
sub.active = pchan.ik_dof_y and pchan.ik_limit_y and pchan.has_ik sub.active = pchan.ik_dof_y and pchan.ik_limit_y and pchan.has_ik
@ -311,22 +276,18 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True) sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
sub.active = pchan.ik_dof_z and pchan.has_ik sub.active = pchan.ik_dof_z and pchan.has_ik
if wide_ui: split = layout.split(percentage=0.25)
split = layout.split(percentage=0.25) sub = split.row()
sub = split.row()
else:
sub = layout.column(align=True)
sub.prop(pchan, "ik_limit_z", text="Limit") sub.prop(pchan, "ik_limit_z", text="Limit")
sub.active = pchan.ik_dof_z and pchan.has_ik sub.active = pchan.ik_dof_z and pchan.has_ik
if wide_ui: sub = split.row(align=True)
sub = split.row(align=True)
sub.prop(pchan, "ik_min_z", text="") sub.prop(pchan, "ik_min_z", text="")
sub.prop(pchan, "ik_max_z", text="") sub.prop(pchan, "ik_max_z", text="")
sub.active = pchan.ik_dof_z and pchan.ik_limit_z and pchan.has_ik sub.active = pchan.ik_dof_z and pchan.ik_limit_z and pchan.has_ik
split = layout.split() split = layout.split()
split.prop(pchan, "ik_stretch", text="Stretch", slider=True) split.prop(pchan, "ik_stretch", text="Stretch", slider=True)
if wide_ui: split.label()
split.label()
split.active = pchan.has_ik split.active = pchan.has_ik
if ob.pose.ik_solver == 'ITASC': if ob.pose.ik_solver == 'ITASC':
@ -334,8 +295,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(pchan, "ik_rot_control", text="Control Rotation") col.prop(pchan, "ik_rot_control", text="Control Rotation")
col.active = pchan.has_ik col.active = pchan.has_ik
if wide_ui: col = split.column()
col = split.column()
col.prop(pchan, "ik_rot_weight", text="Weight", slider=True) col.prop(pchan, "ik_rot_weight", text="Weight", slider=True)
col.active = pchan.has_ik col.active = pchan.has_ik
# not supported yet # not supported yet
@ -360,7 +320,6 @@ class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
bone = context.bone bone = context.bone
wide_ui = context.region.width > narrowui
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
@ -382,8 +341,7 @@ class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel):
sub.prop(bone, "head_radius", text="Head") sub.prop(bone, "head_radius", text="Head")
sub.prop(bone, "tail_radius", text="Tail") sub.prop(bone, "tail_radius", text="Tail")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Curved Bones:") col.label(text="Curved Bones:")
sub = col.column(align=True) sub = col.column(align=True)

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -45,21 +43,14 @@ class DATA_PT_context_camera(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
cam = context.camera cam = context.camera
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif cam:
elif cam: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
if ob:
layout.template_ID(ob, "data")
elif cam:
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_camera(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -85,12 +76,8 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
cam = context.camera cam = context.camera
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(cam, "type", expand=True)
layout.prop(cam, "type", expand=True)
else:
layout.prop(cam, "type", text="")
split = layout.split() split = layout.split()
@ -100,8 +87,7 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
col.prop(cam, "lens", text="Angle") col.prop(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES': elif cam.lens_unit == 'DEGREES':
col.prop(cam, "angle") col.prop(cam, "angle")
if wide_ui: col = split.column()
col = split.column()
col.prop(cam, "lens_unit", text="") col.prop(cam, "lens_unit", text="")
elif cam.type == 'ORTHO': elif cam.type == 'ORTHO':
@ -116,8 +102,7 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
col.prop(cam, "shift_x", text="X") col.prop(cam, "shift_x", text="X")
col.prop(cam, "shift_y", text="Y") col.prop(cam, "shift_y", text="Y")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Clipping:") col.label(text="Clipping:")
col.prop(cam, "clip_start", text="Start") col.prop(cam, "clip_start", text="Start")
col.prop(cam, "clip_end", text="End") col.prop(cam, "clip_end", text="End")
@ -129,10 +114,8 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(cam, "dof_object", text="") col.prop(cam, "dof_object", text="")
if wide_ui: col = split.column()
col = split.column()
else:
col = col.column()
if cam.dof_object != None: if cam.dof_object != None:
col.enabled = False col.enabled = False
col.prop(cam, "dof_distance", text="Distance") col.prop(cam, "dof_distance", text="Distance")
@ -151,7 +134,6 @@ class DATA_PT_camera_display(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
cam = context.camera cam = context.camera
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -161,8 +143,7 @@ class DATA_PT_camera_display(DataButtonsPanel, bpy.types.Panel):
col.prop(cam, "show_title_safe", text="Title Safe") col.prop(cam, "show_title_safe", text="Title Safe")
col.prop(cam, "show_name", text="Name") col.prop(cam, "show_name", text="Name")
if wide_ui: col = split.column()
col = split.column()
col.prop(cam, "draw_size", text="Size") col.prop(cam, "draw_size", text="Size")
col.separator() col.separator()
col.prop(cam, "show_passepartout", text="Passepartout") col.prop(cam, "show_passepartout", text="Passepartout")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -60,20 +58,15 @@ class DATA_PT_context_curve(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
curve = context.curve curve = context.curve
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
split = layout.split(percentage=0.65)
if wide_ui: if ob:
split = layout.split(percentage=0.65) split.template_ID(ob, "data")
split.separator()
if ob: elif curve:
split.template_ID(ob, "data") split.template_ID(space, "pin_id")
split.separator() split.separator()
elif curve:
split.template_ID(space, "pin_id")
split.separator()
else:
layout.template_ID(ob, "data")
class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_curve(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -88,7 +81,6 @@ class DATA_PT_shape_curve(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
curve = context.curve curve = context.curve
wide_ui = context.region.width > narrowui
is_surf = (ob.type == 'SURFACE') is_surf = (ob.type == 'SURFACE')
is_curve = (ob.type == 'CURVE') is_curve = (ob.type == 'CURVE')
is_text = (ob.type == 'TEXT') is_text = (ob.type == 'TEXT')
@ -112,8 +104,7 @@ class DATA_PT_shape_curve(DataButtonsPanel, bpy.types.Panel):
col.label(text="Display:") col.label(text="Display:")
col.prop(curve, "fast", text="Fast Editing") col.prop(curve, "fast", text="Fast Editing")
if wide_ui: col = split.column()
col = split.column()
if is_surf: if is_surf:
sub = col.column(align=True) sub = col.column(align=True)
@ -148,7 +139,6 @@ class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
curve = context.curve curve = context.curve
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -159,8 +149,7 @@ class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel):
col.label(text="Taper Object:") col.label(text="Taper Object:")
col.prop(curve, "taper_object", text="") col.prop(curve, "taper_object", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Bevel:") col.label(text="Bevel:")
col.prop(curve, "bevel_depth", text="Depth") col.prop(curve, "bevel_depth", text="Depth")
col.prop(curve, "bevel_resolution", text="Resolution") col.prop(curve, "bevel_resolution", text="Resolution")
@ -180,7 +169,6 @@ class DATA_PT_pathanim(DataButtonsPanelCurve, bpy.types.Panel):
layout = self.layout layout = self.layout
curve = context.curve curve = context.curve
wide_ui = context.region.width > narrowui
layout.active = curve.use_path layout.active = curve.use_path
@ -195,8 +183,7 @@ class DATA_PT_pathanim(DataButtonsPanelCurve, bpy.types.Panel):
col.prop(curve, "use_stretch") col.prop(curve, "use_stretch")
col.prop(curve, "use_deform_bounds") col.prop(curve, "use_deform_bounds")
if wide_ui: col = split.column()
col = split.column()
col.prop(curve, "use_radius") col.prop(curve, "use_radius")
col.prop(curve, "use_time_offset", text="Offset Children") col.prop(curve, "use_time_offset", text="Offset Children")
@ -284,21 +271,16 @@ class DATA_PT_font(DataButtonsPanel, bpy.types.Panel):
text = context.curve text = context.curve
char = context.curve.edit_format char = context.curve.edit_format
wide_ui = context.region.width > narrowui
layout.template_ID(text, "font", open="font.open", unlink="font.unlink") layout.template_ID(text, "font", open="font.open", unlink="font.unlink")
#if wide_ui: #layout.prop(text, "font")
# layout.prop(text, "font")
#else:
# layout.prop(text, "font", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(text, "text_size", text="Size") col.prop(text, "text_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(text, "shear") col.prop(text, "shear")
split = layout.split() split = layout.split()
@ -307,8 +289,7 @@ class DATA_PT_font(DataButtonsPanel, bpy.types.Panel):
col.label(text="Object Font:") col.label(text="Object Font:")
col.prop(text, "family", text="") col.prop(text, "family", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Text on Curve:") col.label(text="Text on Curve:")
col.prop(text, "text_on_curve", text="") col.prop(text, "text_on_curve", text="")
@ -320,8 +301,7 @@ class DATA_PT_font(DataButtonsPanel, bpy.types.Panel):
colsub.prop(text, "ul_position", text="Position") colsub.prop(text, "ul_position", text="Position")
colsub.prop(text, "ul_height", text="Thickness") colsub.prop(text, "ul_height", text="Thickness")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Character:") col.label(text="Character:")
col.prop(char, "bold") col.prop(char, "bold")
col.prop(char, "italic") col.prop(char, "italic")
@ -346,13 +326,9 @@ class DATA_PT_paragraph(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
text = context.curve text = context.curve
wide_ui = context.region.width > narrowui
layout.label(text="Align:") layout.label(text="Align:")
if wide_ui: layout.prop(text, "spacemode", expand=True)
layout.prop(text, "spacemode", expand=True)
else:
layout.prop(text, "spacemode", text="")
split = layout.split() split = layout.split()
@ -362,8 +338,7 @@ class DATA_PT_paragraph(DataButtonsPanel, bpy.types.Panel):
col.prop(text, "word_spacing", text="Word") col.prop(text, "word_spacing", text="Word")
col.prop(text, "line_dist", text="Line") col.prop(text, "line_dist", text="Line")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Offset:") col.label(text="Offset:")
col.prop(text, "offset_x", text="X") col.prop(text, "offset_x", text="X")
col.prop(text, "offset_y", text="Y") col.prop(text, "offset_y", text="Y")
@ -380,13 +355,11 @@ class DATA_PT_textboxes(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
text = context.curve text = context.curve
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.operator("font.textbox_add", icon='ZOOMIN') col.operator("font.textbox_add", icon='ZOOMIN')
if wide_ui: col = split.column()
col = split.column()
for i, box in enumerate(text.textboxes): for i, box in enumerate(text.textboxes):
@ -402,8 +375,7 @@ class DATA_PT_textboxes(DataButtonsPanel, bpy.types.Panel):
col.prop(box, "width", text="Width") col.prop(box, "width", text="Width")
col.prop(box, "height", text="Height") col.prop(box, "height", text="Height")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Offset:") col.label(text="Offset:")
col.prop(box, "x", text="X") col.prop(box, "x", text="X")

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -39,12 +37,8 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(ob, "empty_draw_type", text="Display")
layout.prop(ob, "empty_draw_type", text="Display")
else:
layout.prop(ob, "empty_draw_type", text="")
layout.prop(ob, "empty_draw_size", text="Size") layout.prop(ob, "empty_draw_size", text="Size")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class LAMP_MT_sunsky_presets(bpy.types.Menu): class LAMP_MT_sunsky_presets(bpy.types.Menu):
bl_label = "Sun & Sky Presets" bl_label = "Sun & Sky Presets"
@ -65,21 +63,14 @@ class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
lamp = context.lamp lamp = context.lamp
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif lamp:
elif lamp: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
if ob:
layout.template_ID(ob, "data")
elif lamp:
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -105,12 +96,8 @@ class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
lamp = context.lamp lamp = context.lamp
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(lamp, "type", expand=True)
layout.prop(lamp, "type", expand=True)
else:
layout.prop(lamp, "type", text="")
split = layout.split() split = layout.split()
@ -136,8 +123,7 @@ class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel):
col.prop(lamp, "distance") col.prop(lamp, "distance")
col.prop(lamp, "gamma") col.prop(lamp, "gamma")
if wide_ui: col = split.column()
col = split.column()
col.prop(lamp, "negative") col.prop(lamp, "negative")
col.prop(lamp, "layer", text="This Layer Only") col.prop(lamp, "layer", text="This Layer Only")
col.prop(lamp, "specular") col.prop(lamp, "specular")
@ -158,7 +144,6 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
lamp = context.lamp.sky lamp = context.lamp.sky
wide_ui = context.region.width > narrowui
row = layout.row(align=True) row = layout.row(align=True)
row.prop(lamp, "use_sky") row.prop(lamp, "use_sky")
@ -183,8 +168,7 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
sub.row().prop(lamp, "sky_color_space", expand=True) sub.row().prop(lamp, "sky_color_space", expand=True)
sub.prop(lamp, "sky_exposure", text="Exposure") sub.prop(lamp, "sky_exposure", text="Exposure")
if wide_ui: col = split.column()
col = split.column()
col.active = lamp.use_sky col.active = lamp.use_sky
col.label(text="Horizon:") col.label(text="Horizon:")
sub = col.column() sub = col.column()
@ -209,8 +193,7 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel):
col.prop(lamp, "sun_intensity", text="Sun") col.prop(lamp, "sun_intensity", text="Sun")
col.prop(lamp, "atmosphere_distance_factor", text="Distance") col.prop(lamp, "atmosphere_distance_factor", text="Distance")
if wide_ui: col = split.column()
col = split.column()
col.active = lamp.use_atmosphere col.active = lamp.use_atmosphere
col.label(text="Scattering:") col.label(text="Scattering:")
sub = col.column(align=True) sub = col.column(align=True)
@ -232,29 +215,8 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
lamp = context.lamp lamp = context.lamp
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(lamp, "shadow_method", expand=True)
layout.prop(lamp, "shadow_method", expand=True)
else:
layout.prop(lamp, "shadow_method", text="")
if lamp.shadow_method == 'NOSHADOW' and lamp.type == 'AREA':
split = layout.split()
col= split.column()
col.label(text="Form factor sampling:")
if wide_ui:
sub=col.row(align=True)
else:
sub=col.column(align=True)
if lamp.shape == 'SQUARE':
sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_method != 'NOSHADOW': if lamp.shadow_method != 'NOSHADOW':
split = layout.split() split = layout.split()
@ -262,65 +224,55 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(lamp, "shadow_color", text="") col.prop(lamp, "shadow_color", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(lamp, "shadow_layer", text="This Layer Only") col.prop(lamp, "shadow_layer", text="This Layer Only")
col.prop(lamp, "only_shadow") col.prop(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW': if lamp.shadow_method == 'RAY_SHADOW':
split = layout.split() col = layout.column()
col = split.column()
col.label(text="Sampling:") col.label(text="Sampling:")
col.row().prop(lamp, "shadow_ray_sampling_method", expand=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'): if lamp.type in ('POINT', 'SUN', 'SPOT'):
if wide_ui: split = layout.split()
sub=col.row()
else: col = split.column()
sub=col.column() col.prop(lamp, "shadow_soft_size", text="Soft Size")
sub.prop(lamp, "shadow_ray_samples", text="Samples") col.prop(lamp, "shadow_ray_samples", text="Samples")
sub.prop(lamp, "shadow_soft_size", text="Soft Size") if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
col = split.column()
elif lamp.type == 'AREA': elif lamp.type == 'AREA':
if wide_ui: split = layout.split()
sub=col.row(align=True)
else: col = split.column()
sub=col.column(align=True)
if lamp.shape == 'SQUARE': if lamp.shape == 'SQUARE':
sub.prop(lamp, "shadow_ray_samples_x", text="Samples") col.prop(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE': elif lamp.shape == 'RECTANGLE':
sub.prop(lamp, "shadow_ray_samples_x", text="Samples X") col.prop(lamp, "shadow_ray_samples_x", text="Samples X")
sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y") col.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
if wide_ui: if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.row().prop(lamp, "shadow_ray_sampling_method", expand=True) col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
else:
col.prop(lamp, "shadow_ray_sampling_method", text="")
split = layout.split()
col = split.column()
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
if wide_ui:
col = split.column() col = split.column()
if lamp.type == 'AREA' and lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
col = split.column() col = split.column()
col = split.column() col.prop(lamp, "umbra")
col.prop(lamp, "umbra") col.prop(lamp, "dither")
col.prop(lamp, "dither") col.prop(lamp, "jitter")
col.prop(lamp, "jitter") else:
col = split.column()
elif lamp.shadow_method == 'BUFFER_SHADOW': elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column() col = layout.column()
col.label(text="Buffer Type:") col.label(text="Buffer Type:")
if wide_ui: col.row().prop(lamp, "shadow_buffer_type", expand=True)
col.row().prop(lamp, "shadow_buffer_type", expand=True)
else:
col.row().prop(lamp, "shadow_buffer_type", text="")
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'): if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
split = layout.split() split = layout.split()
@ -332,8 +284,7 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
sub.prop(lamp, "shadow_buffer_soft", text="Soft") sub.prop(lamp, "shadow_buffer_soft", text="Soft")
sub.prop(lamp, "shadow_buffer_bias", text="Bias") sub.prop(lamp, "shadow_buffer_bias", text="Bias")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Sample Buffers:") col.label(text="Sample Buffers:")
col.prop(lamp, "shadow_sample_buffers", text="") col.prop(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True) sub = col.column(align=True)
@ -353,8 +304,7 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel):
sub.active = not lamp.auto_clip_start sub.active = not lamp.auto_clip_start
sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start") sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
if wide_ui: col = split.column()
col = split.column()
col.prop(lamp, "auto_clip_end", text="Autoclip End") col.prop(lamp, "auto_clip_end", text="Autoclip End")
sub = col.column() sub = col.column()
sub.active = not lamp.auto_clip_end sub.active = not lamp.auto_clip_end
@ -372,21 +322,16 @@ class DATA_PT_area(DataButtonsPanel, bpy.types.Panel):
return (lamp and lamp.type == 'AREA') and (engine in __class__.COMPAT_ENGINES) return (lamp and lamp.type == 'AREA') and (engine in __class__.COMPAT_ENGINES)
def draw(self, context): def draw(self, context):
lamp = context.lamp
wide_ui = context.region.width > narrowui
layout = self.layout layout = self.layout
lamp = context.lamp
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.row().prop(lamp, "shape", expand=True)
if wide_ui:
col.row().prop(lamp, "shape", expand=True)
sub = col.row(align=True)
else:
col.prop(lamp, "shape", text="")
sub = col.column(align=True)
sub = col.column(align=True)
if (lamp.shape == 'SQUARE'): if (lamp.shape == 'SQUARE'):
sub.prop(lamp, "size") sub.prop(lamp, "size")
elif (lamp.shape == 'RECTANGLE'): elif (lamp.shape == 'RECTANGLE'):
@ -408,7 +353,6 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
lamp = context.lamp lamp = context.lamp
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -419,10 +363,8 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel):
col.prop(lamp, "square") col.prop(lamp, "square")
col.prop(lamp, "show_cone") col.prop(lamp, "show_cone")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(lamp, "halo") col.prop(lamp, "halo")
sub = col.column(align=True) sub = col.column(align=True)
sub.active = lamp.halo sub.active = lamp.halo

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -43,21 +41,14 @@ class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
lat = context.lattice lat = context.lattice
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif lat:
elif lat: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
if ob:
layout.template_ID(ob, "data")
elif lat:
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -71,27 +62,23 @@ class DATA_PT_lattice(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
lat = context.lattice lat = context.lattice
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(lat, "points_u") col.prop(lat, "points_u")
if wide_ui: col = split.column()
col = split.column()
col.prop(lat, "interpolation_type_u", text="") col.prop(lat, "interpolation_type_u", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(lat, "points_v") col.prop(lat, "points_v")
if wide_ui: col = split.column()
col = split.column()
col.prop(lat, "interpolation_type_v", text="") col.prop(lat, "interpolation_type_v", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(lat, "points_w") col.prop(lat, "points_w")
if wide_ui: col = split.column()
col = split.column()
col.prop(lat, "interpolation_type_w", text="") col.prop(lat, "interpolation_type_w", text="")
row = layout.row() row = layout.row()

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class MESH_MT_vertex_group_specials(bpy.types.Menu): class MESH_MT_vertex_group_specials(bpy.types.Menu):
bl_label = "Vertex Group Specials" bl_label = "Vertex Group Specials"
@ -71,21 +69,14 @@ class DATA_PT_context_mesh(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
mesh = context.mesh mesh = context.mesh
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif mesh:
elif mesh: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
if ob:
layout.template_ID(ob, "data")
elif mesh:
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_mesh(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -111,7 +102,6 @@ class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mesh = context.mesh mesh = context.mesh
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -121,10 +111,8 @@ class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel):
sub.active = mesh.autosmooth sub.active = mesh.autosmooth
sub.prop(mesh, "autosmooth_angle", text="Angle") sub.prop(mesh, "autosmooth_angle", text="Angle")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(mesh, "double_sided") col.prop(mesh, "double_sided")
@ -210,7 +198,6 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
key = ob.data.shape_keys key = ob.data.shape_keys
kb = ob.active_shape_key kb = ob.active_shape_key
wide_ui = context.region.width > narrowui
enable_edit = ob.mode != 'EDIT' enable_edit = ob.mode != 'EDIT'
enable_edit_value = False enable_edit_value = False
@ -243,17 +230,11 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel):
split = layout.split(percentage=0.4) split = layout.split(percentage=0.4)
row = split.row() row = split.row()
row.enabled = enable_edit row.enabled = enable_edit
if wide_ui: row.prop(key, "relative")
row.prop(key, "relative")
row = split.row() row = split.row()
row.alignment = 'RIGHT' row.alignment = 'RIGHT'
if not wide_ui:
layout.prop(key, "relative")
row = layout.row()
sub = row.row(align=True) sub = row.row(align=True)
subsub = sub.row(align=True) subsub = sub.row(align=True)
subsub.active = enable_edit_value subsub.active = enable_edit_value
@ -281,8 +262,7 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel):
col.prop(kb, "slider_min", text="Min") col.prop(kb, "slider_min", text="Min")
col.prop(kb, "slider_max", text="Max") col.prop(kb, "slider_max", text="Max")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.active = enable_edit_value col.active = enable_edit_value
col.label(text="Blend:") col.label(text="Blend:")
col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="") col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="")
@ -337,7 +317,6 @@ class DATA_PT_texface(DataButtonsPanel):
layout = self.layout layout = self.layout
col = layout.column() col = layout.column()
wide_ui = context.region.width > narrowui
me = context.mesh me = context.mesh
tf = me.faces.active_tface tf = me.faces.active_tface
@ -355,8 +334,7 @@ class DATA_PT_texface(DataButtonsPanel):
col.prop(tf, "twoside") col.prop(tf, "twoside")
col.prop(tf, "object_color") col.prop(tf, "object_color")
if wide_ui: col = split.column()
col = split.column()
col.prop(tf, "halo") col.prop(tf, "halo")
col.prop(tf, "billboard") col.prop(tf, "billboard")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -43,21 +41,14 @@ class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
mball = context.meta_ball mball = context.meta_ball
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if ob:
if ob: split.template_ID(ob, "data")
split.template_ID(ob, "data") split.separator()
split.separator() elif mball:
elif mball: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id") split.separator()
split.separator()
else:
if ob:
layout.template_ID(ob, "data")
elif mball:
layout.template_ID(space, "pin_id")
class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel): class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -71,7 +62,6 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mball = context.meta_ball mball = context.meta_ball
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -81,16 +71,12 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel):
sub.prop(mball, "wire_size", text="View") sub.prop(mball, "wire_size", text="View")
sub.prop(mball, "render_size", text="Render") sub.prop(mball, "render_size", text="Render")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Settings:") col.label(text="Settings:")
col.prop(mball, "threshold", text="Threshold") col.prop(mball, "threshold", text="Threshold")
layout.label(text="Update:") layout.label(text="Update:")
if wide_ui: layout.prop(mball, "flag", expand=True)
layout.prop(mball, "flag", expand=True)
else:
layout.prop(mball, "flag", text="")
class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel): class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
@ -104,12 +90,8 @@ class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
metaelem = context.meta_ball.active_element metaelem = context.meta_ball.active_element
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(metaelem, "type")
layout.prop(metaelem, "type")
else:
layout.prop(metaelem, "type", text="")
split = layout.split() split = layout.split()
@ -119,8 +101,7 @@ class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel):
col.prop(metaelem, "negative", text="Negative") col.prop(metaelem, "negative", text="Negative")
col.prop(metaelem, "hide", text="Hide") col.prop(metaelem, "hide", text="Hide")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
if metaelem.type in ('CUBE', 'ELLIPSOID'): if metaelem.type in ('CUBE', 'ELLIPSOID'):
col.label(text="Size:") col.label(text="Size:")

@ -19,9 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
narrowmod = 260
class DataButtonsPanel(): class DataButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -36,30 +33,27 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
compact_mod = context.region.width < narrowmod
layout.operator_menu_enum("object.modifier_add", "type") layout.operator_menu_enum("object.modifier_add", "type")
for md in ob.modifiers: for md in ob.modifiers:
box = layout.template_modifier(md, compact=compact_mod) box = layout.template_modifier(md)
if box: if box:
# match enum type to our functions, avoids a lookup table. # match enum type to our functions, avoids a lookup table.
getattr(self, md.type)(box, ob, md, wide_ui) getattr(self, md.type)(box, ob, md)
# the mt.type enum is (ab)used for a lookup on function names # the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements # ...to avoid lengthy if statements
# so each type must have a function here. # so each type must have a function here.
def ARMATURE(self, layout, ob, md, wide_ui): def ARMATURE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Object:") col.label(text="Object:")
col.prop(md, "object", text="") col.prop(md, "object", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group::") col.label(text="Vertex Group::")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column() sub = col.column()
@ -73,18 +67,13 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "use_vertex_groups", text="Vertex Groups") col.prop(md, "use_vertex_groups", text="Vertex Groups")
col.prop(md, "use_bone_envelopes", text="Bone Envelopes") col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Deformation:") col.label(text="Deformation:")
col.prop(md, "quaternion") col.prop(md, "quaternion")
col.prop(md, "multi_modifier") col.prop(md, "multi_modifier")
def ARRAY(self, layout, ob, md, wide_ui): def ARRAY(self, layout, ob, md):
if wide_ui: layout.prop(md, "fit_type")
layout.prop(md, "fit_type")
else:
layout.prop(md, "fit_type", text="")
if md.fit_type == 'FIXED_COUNT': if md.fit_type == 'FIXED_COUNT':
layout.prop(md, "count") layout.prop(md, "count")
@ -111,8 +100,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.prop(md, "merge_end_vertices", text="First Last") sub.prop(md, "merge_end_vertices", text="First Last")
sub.prop(md, "merge_distance", text="Distance") sub.prop(md, "merge_distance", text="Distance")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "relative_offset") col.prop(md, "relative_offset")
sub = col.column() sub = col.column()
sub.active = md.relative_offset sub.active = md.relative_offset
@ -131,14 +119,13 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "start_cap") col.prop(md, "start_cap")
col.prop(md, "end_cap") col.prop(md, "end_cap")
def BEVEL(self, layout, ob, md, wide_ui): def BEVEL(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(md, "width") col.prop(md, "width")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "only_vertices") col.prop(md, "only_vertices")
layout.label(text="Limit Method:") layout.label(text="Limit Method:")
@ -148,40 +135,35 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
elif md.limit_method == 'WEIGHT': elif md.limit_method == 'WEIGHT':
layout.row().prop(md, "edge_weight_method", expand=True) layout.row().prop(md, "edge_weight_method", expand=True)
def BOOLEAN(self, layout, ob, md, wide_ui): def BOOLEAN(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Operation:") col.label(text="Operation:")
col.prop(md, "operation", text="") col.prop(md, "operation", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Object:") col.label(text="Object:")
col.prop(md, "object", text="") col.prop(md, "object", text="")
def BUILD(self, layout, ob, md, wide_ui): def BUILD(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(md, "frame_start") col.prop(md, "frame_start")
col.prop(md, "length") col.prop(md, "length")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "randomize") col.prop(md, "randomize")
sub = col.column() sub = col.column()
sub.active = md.randomize sub.active = md.randomize
sub.prop(md, "seed") sub.prop(md, "seed")
def CAST(self, layout, ob, md, wide_ui): def CAST(self, layout, ob, md):
split = layout.split(percentage=0.25) split = layout.split(percentage=0.25)
if wide_ui: split.label(text="Cast Type:")
split.label(text="Cast Type:") split.prop(md, "cast_type", text="")
split.prop(md, "cast_type", text="")
else:
layout.prop(md, "cast_type", text="")
split = layout.split(percentage=0.25) split = layout.split(percentage=0.25)
@ -201,37 +183,35 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Control Object:") col.label(text="Control Object:")
col.prop(md, "object", text="") col.prop(md, "object", text="")
if md.object: if md.object:
col.prop(md, "use_transform") col.prop(md, "use_transform")
def CLOTH(self, layout, ob, md, wide_ui): def CLOTH(self, layout, ob, md):
layout.label(text="See Cloth panel.") layout.label(text="See Cloth panel.")
def COLLISION(self, layout, ob, md, wide_ui): def COLLISION(self, layout, ob, md):
layout.label(text="See Collision panel.") layout.label(text="See Collision panel.")
def CURVE(self, layout, ob, md, wide_ui): def CURVE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Object:") col.label(text="Object:")
col.prop(md, "object", text="") col.prop(md, "object", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
layout.label(text="Deformation Axis:") layout.label(text="Deformation Axis:")
layout.row().prop(md, "deform_axis", expand=True) layout.row().prop(md, "deform_axis", expand=True)
def DECIMATE(self, layout, ob, md, wide_ui): def DECIMATE(self, layout, ob, md):
layout.prop(md, "ratio") layout.prop(md, "ratio")
layout.label(text="Face Count: %s" % str(md.face_count)) layout.label(text="Face Count: %s" % str(md.face_count))
def DISPLACE(self, layout, ob, md, wide_ui): def DISPLACE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -240,8 +220,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Direction:") col.label(text="Direction:")
col.prop(md, "direction", text="") col.prop(md, "direction", text="")
col.label(text="Texture Coordinates:") col.label(text="Texture Coordinates:")
@ -258,11 +237,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(md, "midlevel") col.prop(md, "midlevel")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "strength") col.prop(md, "strength")
def EDGE_SPLIT(self, layout, ob, md, wide_ui): def EDGE_SPLIT(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -271,11 +249,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.active = md.use_edge_angle sub.active = md.use_edge_angle
sub.prop(md, "split_angle") sub.prop(md, "split_angle")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "use_sharp", text="Sharp Edges") col.prop(md, "use_sharp", text="Sharp Edges")
def EXPLODE(self, layout, ob, md, wide_ui): def EXPLODE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -285,8 +262,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
sub.prop(md, "protect") sub.prop(md, "protect")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "split_edges") col.prop(md, "split_edges")
col.prop(md, "unborn") col.prop(md, "unborn")
col.prop(md, "alive") col.prop(md, "alive")
@ -295,10 +271,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
layout.operator("object.explode_refresh", text="Refresh") layout.operator("object.explode_refresh", text="Refresh")
def FLUID_SIMULATION(self, layout, ob, md, wide_ui): def FLUID_SIMULATION(self, layout, ob, md):
layout.label(text="See Fluid panel.") layout.label(text="See Fluid panel.")
def HOOK(self, layout, ob, md, wide_ui): def HOOK(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -307,8 +283,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
if md.object and md.object.type == 'ARMATURE': if md.object and md.object.type == 'ARMATURE':
col.label(text="Bone:") col.label(text="Bone:")
col.prop_object(md, "subtarget", md.object.data, "bones", text="") col.prop_object(md, "subtarget", md.object.data, "bones", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
@ -319,10 +294,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(md, "falloff") col.prop(md, "falloff")
col.prop(md, "force", slider=True) col.prop(md, "force", slider=True)
if wide_ui:
col = split.column() col = split.column()
else:
col.separator()
col.operator("object.hook_reset", text="Reset") col.operator("object.hook_reset", text="Reset")
col.operator("object.hook_recenter", text="Recenter") col.operator("object.hook_recenter", text="Recenter")
@ -332,26 +305,24 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
row.operator("object.hook_select", text="Select") row.operator("object.hook_select", text="Select")
row.operator("object.hook_assign", text="Assign") row.operator("object.hook_assign", text="Assign")
def LATTICE(self, layout, ob, md, wide_ui): def LATTICE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Object:") col.label(text="Object:")
col.prop(md, "object", text="") col.prop(md, "object", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
def MASK(self, layout, ob, md, wide_ui): def MASK(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Mode:") col.label(text="Mode:")
col.prop(md, "mode", text="") col.prop(md, "mode", text="")
if wide_ui: col = split.column()
col = split.column()
if md.mode == 'ARMATURE': if md.mode == 'ARMATURE':
col.label(text="Armature:") col.label(text="Armature:")
col.prop(md, "armature", text="") col.prop(md, "armature", text="")
@ -363,15 +334,14 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
sub.prop(md, "invert") sub.prop(md, "invert")
def MESH_DEFORM(self, layout, ob, md, wide_ui): def MESH_DEFORM(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
sub = col.column() sub = col.column()
sub.label(text="Object:") sub.label(text="Object:")
sub.prop(md, "object", text="") sub.prop(md, "object", text="")
sub.active = not md.is_bound sub.active = not md.is_bound
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
@ -391,16 +361,12 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(md, "precision") col.prop(md, "precision")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "dynamic") col.prop(md, "dynamic")
def MIRROR(self, layout, ob, md, wide_ui): def MIRROR(self, layout, ob, md):
layout.prop(md, "merge_limit") layout.prop(md, "merge_limit")
if wide_ui: split = layout.split(percentage=0.25)
split = layout.split(percentage=0.25)
else:
split = layout.split(percentage=0.4)
col = split.column() col = split.column()
col.label(text="Axis:") col.label(text="Axis:")
@ -408,11 +374,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "y") col.prop(md, "y")
col.prop(md, "z") col.prop(md, "z")
if wide_ui: col = split.column()
col = split.column()
else:
subsplit = layout.split()
col = subsplit.column()
col.label(text="Options:") col.label(text="Options:")
col.prop(md, "clip", text="Clipping") col.prop(md, "clip", text="Clipping")
col.prop(md, "mirror_vertex_groups", text="Vertex Groups") col.prop(md, "mirror_vertex_groups", text="Vertex Groups")
@ -426,11 +388,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.label(text="Mirror Object:") col.label(text="Mirror Object:")
col.prop(md, "mirror_object", text="") col.prop(md, "mirror_object", text="")
def MULTIRES(self, layout, ob, md, wide_ui): def MULTIRES(self, layout, ob, md):
if wide_ui: layout.row().prop(md, "subdivision_type", expand=True)
layout.row().prop(md, "subdivision_type", expand=True)
else:
layout.row().prop(md, "subdivision_type", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -438,8 +397,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "sculpt_levels", text="Sculpt") col.prop(md, "sculpt_levels", text="Sculpt")
col.prop(md, "render_levels", text="Render") col.prop(md, "render_levels", text="Render")
if wide_ui: col = split.column()
col = split.column()
col.enabled = ob.mode != 'EDIT' col.enabled = ob.mode != 'EDIT'
col.operator("object.multires_subdivide", text="Subdivide") col.operator("object.multires_subdivide", text="Subdivide")
@ -460,7 +418,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
row.operator("object.multires_external_save", text="Save External...") row.operator("object.multires_external_save", text="Save External...")
row.label() row.label()
def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui): def PARTICLE_INSTANCE(self, layout, ob, md):
layout.prop(md, "object") layout.prop(md, "object")
layout.prop(md, "particle_system_number", text="Particle System") layout.prop(md, "particle_system_number", text="Particle System")
@ -471,8 +429,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "children") col.prop(md, "children")
col.prop(md, "size") col.prop(md, "size")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Show Particles When:") col.label(text="Show Particles When:")
col.prop(md, "alive") col.prop(md, "alive")
col.prop(md, "unborn") col.prop(md, "unborn")
@ -488,15 +445,14 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.row().prop(md, "axis", expand=True) col.row().prop(md, "axis", expand=True)
col.prop(md, "keep_shape") col.prop(md, "keep_shape")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "position", slider=True) col.prop(md, "position", slider=True)
col.prop(md, "random_position", text="Random", slider=True) col.prop(md, "random_position", text="Random", slider=True)
def PARTICLE_SYSTEM(self, layout, ob, md, wide_ui): def PARTICLE_SYSTEM(self, layout, ob, md):
layout.label(text="See Particle panel.") layout.label(text="See Particle panel.")
def SCREW(self, layout, ob, md, wide_ui): def SCREW(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -506,8 +462,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "steps") col.prop(md, "steps")
col.prop(md, "render_steps") col.prop(md, "render_steps")
if wide_ui: col = split.column()
col = split.column()
row = col.row() row = col.row()
row.active = (md.object is None or md.use_object_screw_offset == False) row.active = (md.object is None or md.use_object_screw_offset == False)
row.prop(md, "screw_offset") row.prop(md, "screw_offset")
@ -518,13 +473,12 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "use_normal_flip") col.prop(md, "use_normal_flip")
col.prop(md, "iterations") col.prop(md, "iterations")
def SHRINKWRAP(self, layout, ob, md, wide_ui): def SHRINKWRAP(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Target:") col.label(text="Target:")
col.prop(md, "target", text="") col.prop(md, "target", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
@ -534,15 +488,12 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "offset") col.prop(md, "offset")
col.prop(md, "subsurf_levels") col.prop(md, "subsurf_levels")
if wide_ui: col = split.column()
col = split.column() col.label(text="Mode:")
col.label(text="Mode:")
col.prop(md, "mode", text="") col.prop(md, "mode", text="")
if wide_ui: split = layout.split(percentage=0.25)
split = layout.split(percentage=0.25)
else:
split = layout.split(percentage=0.35)
col = split.column() col = split.column()
if md.mode == 'PROJECT': if md.mode == 'PROJECT':
@ -556,11 +507,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "negative") col.prop(md, "negative")
col.prop(md, "positive") col.prop(md, "positive")
if wide_ui: col = split.column()
col = split.column()
else:
subsplit = layout.split()
col = subsplit.column()
col.label(text="Cull Faces:") col.label(text="Cull Faces:")
col.prop(md, "cull_front_faces", text="Front") col.prop(md, "cull_front_faces", text="Front")
col.prop(md, "cull_back_faces", text="Back") col.prop(md, "cull_back_faces", text="Back")
@ -571,15 +519,14 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
elif md.mode == 'NEAREST_SURFACEPOINT': elif md.mode == 'NEAREST_SURFACEPOINT':
layout.prop(md, "keep_above_surface") layout.prop(md, "keep_above_surface")
def SIMPLE_DEFORM(self, layout, ob, md, wide_ui): def SIMPLE_DEFORM(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="Mode:") col.label(text="Mode:")
col.prop(md, "mode", text="") col.prop(md, "mode", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
@ -592,8 +539,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.active = (md.origin != "") sub.active = (md.origin != "")
sub.prop(md, "relative") sub.prop(md, "relative")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Deform:") col.label(text="Deform:")
col.prop(md, "factor") col.prop(md, "factor")
col.prop(md, "limits", slider=True) col.prop(md, "limits", slider=True)
@ -601,10 +547,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "lock_x_axis") col.prop(md, "lock_x_axis")
col.prop(md, "lock_y_axis") col.prop(md, "lock_y_axis")
def SMOKE(self, layout, ob, md, wide_ui): def SMOKE(self, layout, ob, md):
layout.label(text="See Smoke panel.") layout.label(text="See Smoke panel.")
def SMOOTH(self, layout, ob, md, wide_ui): def SMOOTH(self, layout, ob, md):
split = layout.split(percentage=0.25) split = layout.split(percentage=0.25)
col = split.column() col = split.column()
@ -619,10 +565,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
def SOFT_BODY(self, layout, ob, md, wide_ui): def SOFT_BODY(self, layout, ob, md):
layout.label(text="See Soft Body panel.") layout.label(text="See Soft Body panel.")
def SOLIDIFY(self, layout, ob, md, wide_ui): def SOLIDIFY(self, layout, ob, md):
split = layout.split() split = layout.split()
@ -635,8 +581,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "edge_crease_outer", text="Outer") col.prop(md, "edge_crease_outer", text="Outer")
col.prop(md, "edge_crease_rim", text="Rim") col.prop(md, "edge_crease_rim", text="Rim")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "offset") col.prop(md, "offset")
colsub = col.column() colsub = col.column()
@ -655,11 +600,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
# col.label(text="Vertex Group:") # col.label(text="Vertex Group:")
# col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") # col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
def SUBSURF(self, layout, ob, md, wide_ui): def SUBSURF(self, layout, ob, md):
if wide_ui: layout.row().prop(md, "subdivision_type", expand=True)
layout.row().prop(md, "subdivision_type", expand=True)
else:
layout.row().prop(md, "subdivision_type", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -667,16 +609,15 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "levels", text="View") col.prop(md, "levels", text="View")
col.prop(md, "render_levels", text="Render") col.prop(md, "render_levels", text="Render")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Options:") col.label(text="Options:")
col.prop(md, "subsurf_uv") col.prop(md, "subsurf_uv")
col.prop(md, "optimal_display") col.prop(md, "optimal_display")
def SURFACE(self, layout, ob, md, wide_ui): def SURFACE(self, layout, ob, md):
layout.label(text="See Fields panel.") layout.label(text="See Fields panel.")
def UV_PROJECT(self, layout, ob, md, wide_ui): def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH': if ob.type == 'MESH':
split = layout.split() split = layout.split()
@ -684,8 +625,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.label(text="Image:") col.label(text="Image:")
col.prop(md, "image", text="") col.prop(md, "image", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="UV Layer:") col.label(text="UV Layer:")
col.prop_object(md, "uv_layer", ob.data, "uv_textures", text="") col.prop_object(md, "uv_layer", ob.data, "uv_textures", text="")
@ -696,8 +636,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
for proj in md.projectors: for proj in md.projectors:
col.prop(proj, "object", text="") col.prop(proj, "object", text="")
if wide_ui: col = split.column()
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(md, "aspect_x", text="Aspect X") sub.prop(md, "aspect_x", text="Aspect X")
sub.prop(md, "aspect_y", text="Aspect Y") sub.prop(md, "aspect_y", text="Aspect Y")
@ -706,7 +645,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.prop(md, "scale_x", text="Scale X") sub.prop(md, "scale_x", text="Scale X")
sub.prop(md, "scale_y", text="Scale Y") sub.prop(md, "scale_y", text="Scale Y")
def WAVE(self, layout, ob, md, wide_ui): def WAVE(self, layout, ob, md):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -715,8 +654,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "y") col.prop(md, "y")
col.prop(md, "cyclic") col.prop(md, "cyclic")
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "normals") col.prop(md, "normals")
sub = col.column() sub = col.column()
sub.active = md.normals sub.active = md.normals
@ -733,8 +671,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
sub.prop(md, "lifetime", text="Life") sub.prop(md, "lifetime", text="Life")
col.prop(md, "damping_time", text="Damping") col.prop(md, "damping_time", text="Damping")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Position:") col.label(text="Position:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(md, "start_position_x", text="X") sub.prop(md, "start_position_x", text="X")
@ -760,8 +697,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel):
col.prop(md, "speed", slider=True) col.prop(md, "speed", slider=True)
col.prop(md, "height", slider=True) col.prop(md, "height", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(md, "width", slider=True) col.prop(md, "width", slider=True)
col.prop(md, "narrowness", slider=True) col.prop(md, "narrowness", slider=True)

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicsButtonsPanel(): class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -44,12 +42,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
ob = context.active_object ob = context.active_object
game = ob.game game = ob.game
soft = ob.game.soft_body soft = ob.game.soft_body
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(game, "physics_type")
layout.prop(game, "physics_type")
else:
layout.prop(game, "physics_type", text="")
layout.separator() layout.separator()
#if game.physics_type == 'DYNAMIC': #if game.physics_type == 'DYNAMIC':
@ -61,8 +55,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(game, "ghost") col.prop(game, "ghost")
col.prop(ob, "hide_render", text="Invisible") # out of place but useful col.prop(ob, "hide_render", text="Invisible") # out of place but useful
if wide_ui: col = split.column()
col = split.column()
col.prop(game, "material_physics") col.prop(game, "material_physics")
col.prop(game, "rotate_from_normal") col.prop(game, "rotate_from_normal")
col.prop(game, "no_sleeping") col.prop(game, "no_sleeping")
@ -77,8 +70,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(game, "radius") col.prop(game, "radius")
col.prop(game, "form_factor") col.prop(game, "form_factor")
if wide_ui: col = split.column()
col = split.column()
sub = col.column() sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY') sub.active = (game.physics_type == 'RIGID_BODY')
sub.prop(game, "anisotropic_friction") sub.prop(game, "anisotropic_friction")
@ -94,8 +86,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
sub.prop(game, "minimum_velocity", text="Minimum") sub.prop(game, "minimum_velocity", text="Minimum")
sub.prop(game, "maximum_velocity", text="Maximum") sub.prop(game, "maximum_velocity", text="Maximum")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Damping:") col.label(text="Damping:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(game, "damping", text="Translation", slider=True) sub.prop(game, "damping", text="Translation", slider=True)
@ -137,8 +128,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(soft, "margin", slider=True) col.prop(soft, "margin", slider=True)
col.prop(soft, "bending_const", text="Bending Constraints") col.prop(soft, "bending_const", text="Bending Constraints")
if wide_ui: col = split.column()
col = split.column()
col.prop(soft, "shape_match") col.prop(soft, "shape_match")
sub = col.column() sub = col.column()
sub.active = soft.shape_match sub.active = soft.shape_match
@ -182,21 +172,16 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
game = context.active_object.game game = context.active_object.game
wide_ui = context.region.width > narrowui
layout.active = game.use_collision_bounds layout.active = game.use_collision_bounds
if wide_ui: layout.prop(game, "collision_bounds", text="Bounds")
layout.prop(game, "collision_bounds", text="Bounds")
else:
layout.prop(game, "collision_bounds", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(game, "collision_margin", text="Margin", slider=True) col.prop(game, "collision_margin", text="Margin", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(game, "collision_compound", text="Compound") col.prop(game, "collision_compound", text="Compound")
@ -236,7 +221,6 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
gs = context.scene.game_data gs = context.scene.game_data
wide_ui = context.region.width > narrowui
layout.prop(gs, "fullscreen") layout.prop(gs, "fullscreen")
@ -248,8 +232,7 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
sub.prop(gs, "resolution_x", slider=False, text="X") sub.prop(gs, "resolution_x", slider=False, text="X")
sub.prop(gs, "resolution_y", slider=False, text="Y") sub.prop(gs, "resolution_y", slider=False, text="Y")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Quality:") col.label(text="Quality:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(gs, "depth", text="Bit Depth", slider=False) sub.prop(gs, "depth", text="Bit Depth", slider=False)
@ -258,10 +241,7 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
# framing: # framing:
col = layout.column() col = layout.column()
col.label(text="Framing:") col.label(text="Framing:")
if wide_ui: col.row().prop(gs, "framing_type", expand=True)
col.row().prop(gs, "framing_type", expand=True)
else:
col.prop(gs, "framing_type", text="")
if gs.framing_type == 'LETTERBOX': if gs.framing_type == 'LETTERBOX':
col.prop(gs, "framing_color", text="") col.prop(gs, "framing_color", text="")
@ -280,7 +260,6 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
gs = context.scene.game_data gs = context.scene.game_data
stereo_mode = gs.stereo stereo_mode = gs.stereo
wide_ui = context.region.width > narrowui
# stereo options: # stereo options:
layout.prop(gs, "stereo", expand=True) layout.prop(gs, "stereo", expand=True)
@ -292,10 +271,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
# dome: # dome:
elif stereo_mode == 'DOME': elif stereo_mode == 'DOME':
if wide_ui: layout.prop(gs, "dome_mode", text="Dome Type")
layout.prop(gs, "dome_mode", text="Dome Type")
else:
layout.prop(gs, "dome_mode", text="")
dome_type = gs.dome_mode dome_type = gs.dome_mode
@ -309,8 +285,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col.prop(gs, "dome_angle", slider=True) col.prop(gs, "dome_angle", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(gs, "dome_tesselation", text="Tesselation") col.prop(gs, "dome_tesselation", text="Tesselation")
col.prop(gs, "dome_tilt") col.prop(gs, "dome_tilt")
@ -318,15 +293,14 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(gs, "dome_tesselation", text="Tesselation") col.prop(gs, "dome_tesselation", text="Tesselation")
else: # cube map else: # cube map
col = split.column() col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui:
col = split.column() col = split.column()
layout.prop(gs, "dome_text") layout.prop(gs, "dome_text")
@ -344,12 +318,8 @@ class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
gs = context.scene.game_data gs = context.scene.game_data
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(gs, "material_mode", expand=True)
layout.prop(gs, "material_mode", expand=True)
else:
layout.prop(gs, "material_mode", text="")
if gs.material_mode == 'GLSL': if gs.material_mode == 'GLSL':
split = layout.split() split = layout.split()
@ -378,7 +348,6 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
gs = context.scene.game_data gs = context.scene.game_data
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -389,8 +358,8 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
col.prop(gs, "show_physics_visualization", text="Physics Visualization") col.prop(gs, "show_physics_visualization", text="Physics Visualization")
col.prop(gs, "use_deprecation_warnings") col.prop(gs, "use_deprecation_warnings")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Render:") col.label(text="Render:")
col.prop(gs, "use_frame_rate") col.prop(gs, "use_frame_rate")
col.prop(gs, "use_display_lists") col.prop(gs, "use_display_lists")
@ -409,12 +378,9 @@ class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
scene = context.scene scene = context.scene
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(scene, "distance_model")
layout.prop(scene, "distance_model")
else:
layout.prop(scene, "distance_model", text="")
layout.prop(scene, "speed_of_sound", text="Speed") layout.prop(scene, "speed_of_sound", text="Speed")
layout.prop(scene, "doppler_factor") layout.prop(scene, "doppler_factor")
@ -441,19 +407,12 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel):
scene = context.scene scene = context.scene
world = context.world world = context.world
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) if scene:
if scene: split.template_ID(scene, "world", new="world.new")
split.template_ID(scene, "world", new="world.new") elif world:
elif world: split.template_ID(space, "pin_id")
split.template_ID(space, "pin_id")
else:
if scene:
layout.template_ID(scene, "world", new="world.new")
elif world:
layout.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel): class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
@ -469,15 +428,13 @@ class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
world = context.world world = context.world
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(world, "horizon_color") col.prop(world, "horizon_color")
if wide_ui: col = split.column()
col = split.column()
col.prop(world, "ambient_color") col.prop(world, "ambient_color")
@ -499,7 +456,6 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
world = context.world world = context.world
wide_ui = context.region.width > narrowui
layout.active = world.mist.use_mist layout.active = world.mist.use_mist
split = layout.split() split = layout.split()
@ -507,8 +463,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(world.mist, "start") col.prop(world.mist, "start")
if wide_ui: col = split.column()
col = split.column()
col.prop(world.mist, "depth") col.prop(world.mist, "depth")
@ -525,7 +480,6 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
gs = context.scene.game_data gs = context.scene.game_data
wide_ui = context.region.width > narrowui
layout.prop(gs, "physics_engine") layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE': if gs.physics_engine != 'NONE':
@ -540,8 +494,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
sub.prop(gs, "physics_step_sub", text="Substeps") sub.prop(gs, "physics_step_sub", text="Substeps")
col.prop(gs, "fps", text="FPS") col.prop(gs, "fps", text="FPS")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Logic Steps:") col.label(text="Logic Steps:")
col.prop(gs, "logic_step_max", text="Max") col.prop(gs, "logic_step_max", text="Max")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
def active_node_mat(mat): def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
@ -89,7 +87,6 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
slot = context.material_slot slot = context.material_slot
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
if ob: if ob:
row = layout.row() row = layout.row()
@ -108,33 +105,24 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
row.operator("object.material_slot_select", text="Select") row.operator("object.material_slot_select", text="Select")
row.operator("object.material_slot_deselect", text="Deselect") row.operator("object.material_slot_deselect", text="Deselect")
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65)
if ob: if ob:
split.template_ID(ob, "active_material", new="material.new") split.template_ID(ob, "active_material", new="material.new")
row = split.row() row = split.row()
if mat: if mat:
row.prop(mat, "use_nodes", icon="NODETREE", text="") row.prop(mat, "use_nodes", icon="NODETREE", text="")
if slot: if slot:
row.prop(slot, "link", text="") row.prop(slot, "link", text="")
else: else:
row.label() row.label()
elif mat: elif mat:
split.template_ID(space, "pin_id") split.template_ID(space, "pin_id")
split.separator() split.separator()
else:
if ob:
layout.template_ID(ob, "active_material", new="material.new")
elif mat:
layout.template_ID(space, "pin_id")
if mat: if mat:
if wide_ui: layout.prop(mat, "type", expand=True)
layout.prop(mat, "type", expand=True)
else:
layout.prop(mat, "type", text="")
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel): class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -160,7 +148,6 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
if mat.type in ('SURFACE', 'WIRE'): if mat.type in ('SURFACE', 'WIRE'):
split = layout.split() split = layout.split()
@ -173,8 +160,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel):
sub = col.column() sub = col.column()
sub.prop(mat, "translucency") sub.prop(mat, "translucency")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "shadeless") col.prop(mat, "shadeless")
sub = col.column() sub = col.column()
sub.active = not mat.shadeless sub.active = not mat.shadeless
@ -201,7 +187,6 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material mat = context.material # dont use node material
tan = mat.strand tan = mat.strand
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -217,8 +202,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
sub.prop(tan, "tangent_shading") sub.prop(tan, "tangent_shading")
col.prop(tan, "shape") col.prop(tan, "shape")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Shading:") col.label(text="Shading:")
col.prop(tan, "width_fade") col.prop(tan, "width_fade")
ob = context.object ob = context.object
@ -247,7 +231,6 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
phys = context.material.physics # dont use node material phys = context.material.physics # dont use node material
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -256,8 +239,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
col.prop(phys, "friction") col.prop(phys, "friction")
col.prop(phys, "align_to_normal") col.prop(phys, "align_to_normal")
if wide_ui: col = split.column()
col = split.column()
col.prop(phys, "force", slider=True) col.prop(phys, "force", slider=True)
col.prop(phys, "elasticity", slider=True) col.prop(phys, "elasticity", slider=True)
col.prop(phys, "damp", slider=True) col.prop(phys, "damp", slider=True)
@ -277,7 +259,6 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -297,8 +278,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel):
row.active = bool(mat.light_group) row.active = bool(mat.light_group)
row.prop(mat, "light_group_exclusive", text="Exclusive") row.prop(mat, "light_group_exclusive", text="Exclusive")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "face_texture") col.prop(mat, "face_texture")
sub = col.column() sub = col.column()
sub.active = mat.face_texture sub.active = mat.face_texture
@ -324,7 +304,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -335,8 +314,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
col.prop(mat, "cast_shadows_only", text="Cast Only") col.prop(mat, "cast_shadows_only", text="Cast Only")
col.prop(mat, "shadow_casting_alpha", text="Casting Alpha") col.prop(mat, "shadow_casting_alpha", text="Casting Alpha")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "cast_buffer_shadows") col.prop(mat, "cast_buffer_shadows")
sub = col.column() sub = col.column()
sub.active = mat.cast_buffer_shadows sub.active = mat.cast_buffer_shadows
@ -361,7 +339,6 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -371,8 +348,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
sub.active = (not mat.shadeless) sub.active = (not mat.shadeless)
sub.prop(mat, "diffuse_intensity", text="Intensity") sub.prop(mat, "diffuse_intensity", text="Intensity")
if wide_ui: col = split.column()
col = split.column()
col.active = (not mat.shadeless) col.active = (not mat.shadeless)
col.prop(mat, "diffuse_shader", text="") col.prop(mat, "diffuse_shader", text="")
col.prop(mat, "use_diffuse_ramp", text="Ramp") col.prop(mat, "use_diffuse_ramp", text="Ramp")
@ -389,8 +365,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "diffuse_toon_size", text="Size") col.prop(mat, "diffuse_toon_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "diffuse_toon_smooth", text="Smooth") col.prop(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL': elif mat.diffuse_shader == 'FRESNEL':
split = col.split() split = col.split()
@ -398,8 +373,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "diffuse_fresnel", text="Fresnel") col.prop(mat, "diffuse_fresnel", text="Fresnel")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "diffuse_fresnel_factor", text="Factor") col.prop(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp: if mat.use_diffuse_ramp:
@ -412,8 +386,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "diffuse_ramp_input", text="Input") col.prop(mat, "diffuse_ramp_input", text="Input")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "diffuse_ramp_blend", text="Blend") col.prop(mat, "diffuse_ramp_blend", text="Blend")
row = layout.row() row = layout.row()
row.prop(mat, "diffuse_ramp_factor", text="Factor") row.prop(mat, "diffuse_ramp_factor", text="Factor")
@ -433,7 +406,6 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
layout.active = (not mat.shadeless) layout.active = (not mat.shadeless)
@ -443,8 +415,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col.prop(mat, "specular_color", text="") col.prop(mat, "specular_color", text="")
col.prop(mat, "specular_intensity", text="Intensity") col.prop(mat, "specular_intensity", text="Intensity")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "specular_shader", text="") col.prop(mat, "specular_shader", text="")
col.prop(mat, "use_specular_ramp", text="Ramp") col.prop(mat, "use_specular_ramp", text="Ramp")
@ -457,8 +428,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "specular_hardness", text="Hardness") col.prop(mat, "specular_hardness", text="Hardness")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "specular_ior", text="IOR") col.prop(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO': elif mat.specular_shader == 'WARDISO':
col.prop(mat, "specular_slope", text="Slope") col.prop(mat, "specular_slope", text="Slope")
@ -468,8 +438,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "specular_toon_size", text="Size") col.prop(mat, "specular_toon_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "specular_toon_smooth", text="Smooth") col.prop(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp: if mat.use_specular_ramp:
@ -481,8 +450,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(mat, "specular_ramp_input", text="Input") col.prop(mat, "specular_ramp_input", text="Input")
if wide_ui: col = split.column()
col = split.column()
col.prop(mat, "specular_ramp_blend", text="Blend") col.prop(mat, "specular_ramp_blend", text="Blend")
row = layout.row() row = layout.row()
@ -512,7 +480,6 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
sss = mat.subsurface_scattering sss = mat.subsurface_scattering
wide_ui = context.region.width > narrowui
layout.active = (sss.enabled) and (not mat.shadeless) layout.active = (sss.enabled) and (not mat.shadeless)
@ -529,8 +496,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel):
col.prop(sss, "color", text="") col.prop(sss, "color", text="")
col.prop(sss, "radius", text="RGB Radius", expand=True) col.prop(sss, "radius", text="RGB Radius", expand=True)
if wide_ui: col = split.column()
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.label(text="Blend:") sub.label(text="Blend:")
sub.prop(sss, "color_factor", text="Color") sub.prop(sss, "color_factor", text="Color")
@ -563,7 +529,6 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
raym = mat.raytrace_mirror raym = mat.raytrace_mirror
wide_ui = context.region.width > narrowui
layout.active = raym.enabled layout.active = raym.enabled
@ -573,8 +538,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
col.prop(raym, "reflect_factor") col.prop(raym, "reflect_factor")
col.prop(mat, "mirror_color", text="") col.prop(mat, "mirror_color", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(raym, "fresnel") col.prop(raym, "fresnel")
sub = col.column() sub = col.column()
sub.active = raym.fresnel > 0 sub.active = raym.fresnel > 0
@ -592,8 +556,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
sub.label(text="Fade To:") sub.label(text="Fade To:")
sub.prop(raym, "fade_to", text="") sub.prop(raym, "fade_to", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Gloss:") col.label(text="Gloss:")
col.prop(raym, "gloss_factor", text="Amount") col.prop(raym, "gloss_factor", text="Amount")
sub = col.column() sub = col.column()
@ -624,14 +587,10 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency rayt = mat.raytrace_transparency
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.active = mat.transparency and (not mat.shadeless) row.active = mat.transparency and (not mat.shadeless)
if wide_ui: row.prop(mat, "transparency_method", expand=True)
row.prop(mat, "transparency_method", expand=True)
else:
row.prop(mat, "transparency_method", text="")
split = layout.split() split = layout.split()
@ -641,8 +600,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
row.active = mat.transparency and (not mat.shadeless) row.active = mat.transparency and (not mat.shadeless)
row.prop(mat, "specular_alpha", text="Specular") row.prop(mat, "specular_alpha", text="Specular")
if wide_ui: col = split.column()
col = split.column()
col.active = (not mat.shadeless) col.active = (not mat.shadeless)
col.prop(rayt, "fresnel") col.prop(rayt, "fresnel")
sub = col.column() sub = col.column()
@ -661,8 +619,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel):
col.prop(rayt, "limit") col.prop(rayt, "limit")
col.prop(rayt, "depth") col.prop(rayt, "depth")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Gloss:") col.label(text="Gloss:")
col.prop(rayt, "gloss_factor", text="Amount") col.prop(rayt, "gloss_factor", text="Amount")
sub = col.column() sub = col.column()
@ -692,14 +649,10 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel):
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency rayt = mat.raytrace_transparency
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.active = mat.transparency and (not mat.shadeless) row.active = mat.transparency and (not mat.shadeless)
if wide_ui: row.prop(mat, "transparency_method", expand=True)
row.prop(mat, "transparency_method", expand=True)
else:
row.prop(mat, "transparency_method", text="")
split = layout.split() split = layout.split()
@ -722,7 +675,6 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material mat = context.material # dont use node material
halo = mat.halo halo = mat.halo
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -738,8 +690,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel):
col.prop(halo, "shaded") col.prop(halo, "shaded")
col.prop(halo, "soft") col.prop(halo, "soft")
if wide_ui: col = split.column()
col = split.column()
col.prop(halo, "ring") col.prop(halo, "ring")
sub = col.column() sub = col.column()
sub.active = halo.ring sub.active = halo.ring
@ -778,7 +729,6 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
mat = context.material # dont use node material mat = context.material # dont use node material
halo = mat.halo halo = mat.halo
wide_ui = context.region.width > narrowui
layout.active = halo.flare_mode layout.active = halo.flare_mode
@ -788,8 +738,8 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel):
col.prop(halo, "flare_size", text="Size") col.prop(halo, "flare_size", text="Size")
col.prop(halo, "flare_boost", text="Boost") col.prop(halo, "flare_boost", text="Boost")
col.prop(halo, "flare_seed", text="Seed") col.prop(halo, "flare_seed", text="Seed")
if wide_ui:
col = split.column() col = split.column()
col.prop(halo, "flares_sub", text="Subflares") col.prop(halo, "flares_sub", text="Subflares")
col.prop(halo, "flare_subsize", text="Subsize") col.prop(halo, "flare_subsize", text="Subsize")
@ -816,14 +766,12 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
vol = context.material.volume # dont use node material vol = context.material.volume # dont use node material
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(vol, "density") col.prop(vol, "density")
if wide_ui: col = split.column()
col = split.column()
col.prop(vol, "density_scale") col.prop(vol, "density_scale")
@ -836,7 +784,6 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
vol = context.material.volume # dont use node material vol = context.material.volume # dont use node material
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -845,8 +792,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel):
col.prop(vol, "asymmetry") col.prop(vol, "asymmetry")
col.prop(vol, "transmission_color") col.prop(vol, "transmission_color")
if wide_ui: col = split.column()
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(vol, "emission") sub.prop(vol, "emission")
sub.prop(vol, "emission_color", text="") sub.prop(vol, "emission_color", text="")
@ -864,15 +810,13 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
vol = context.material.volume # dont use node material vol = context.material.volume # dont use node material
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(vol, "lighting_mode", text="") col.prop(vol, "lighting_mode", text="")
if wide_ui: col = split.column()
col = split.column()
if vol.lighting_mode == 'SHADED': if vol.lighting_mode == 'SHADED':
col.prop(vol, "external_shadows") col.prop(vol, "external_shadows")
@ -901,12 +845,8 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = context.material # dont use node material mat = context.material # dont use node material
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(mat, "transparency_method", expand=True)
layout.prop(mat, "transparency_method", expand=True)
else:
layout.prop(mat, "transparency_method", text="")
class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel): class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
@ -918,7 +858,6 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
vol = context.material.volume # dont use node material vol = context.material.volume # dont use node material
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -928,8 +867,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel):
col = col.column(align=True) col = col.column(align=True)
col.prop(vol, "step_size") col.prop(vol, "step_size")
if wide_ui: col = split.column()
col = split.column()
col.label() col.label()
col.prop(vol, "depth_cutoff") col.prop(vol, "depth_cutoff")
@ -943,7 +881,6 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
mat = active_node_mat(context.material) mat = active_node_mat(context.material)
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class ObjectButtonsPanel(): class ObjectButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -53,37 +51,23 @@ class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
if wide_ui: row = layout.row()
row = layout.row()
row.column().prop(ob, "location") row.column().prop(ob, "location")
if ob.rotation_mode == 'QUATERNION': if ob.rotation_mode == 'QUATERNION':
row.column().prop(ob, "rotation_quaternion", text="Rotation") row.column().prop(ob, "rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE': elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().label(text="Rotation") #row.column().label(text="Rotation")
#row.column().prop(pchan, "rotation_angle", text="Angle") #row.column().prop(pchan, "rotation_angle", text="Angle")
#row.column().prop(pchan, "rotation_axis", text="Axis") #row.column().prop(pchan, "rotation_axis", text="Axis")
row.column().prop(ob, "rotation_axis_angle", text="Rotation") row.column().prop(ob, "rotation_axis_angle", text="Rotation")
else:
row.column().prop(ob, "rotation_euler", text="Rotation")
row.column().prop(ob, "scale")
layout.prop(ob, "rotation_mode")
else: else:
col = layout.column() row.column().prop(ob, "rotation_euler", text="Rotation")
col.prop(ob, "location")
col.label(text="Rotation:") row.column().prop(ob, "scale")
col.prop(ob, "rotation_mode", text="")
if ob.rotation_mode == 'QUATERNION': layout.prop(ob, "rotation_mode")
col.prop(ob, "rotation_quaternion", text="")
elif ob.rotation_mode == 'AXIS_ANGLE':
col.prop(ob, "rotation_axis_angle", text="")
else:
col.prop(ob, "rotation_euler", text="")
col.prop(ob, "scale")
class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel): class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):
@ -94,7 +78,6 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
# wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
@ -120,7 +103,6 @@ class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -129,8 +111,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel):
col.separator() col.separator()
col.prop(ob, "pass_index") col.prop(ob, "pass_index")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Parent:") col.label(text="Parent:")
col.prop(ob, "parent", text="") col.prop(ob, "parent", text="")
@ -149,7 +130,6 @@ class OBJECT_PT_groups(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
row = layout.row(align=True) row = layout.row(align=True)
row.operator("object.group_link", text="Add to Group") row.operator("object.group_link", text="Add to Group")
@ -173,8 +153,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(group, "layer", text="Dupli") col.prop(group, "layer", text="Dupli")
if wide_ui: col = split.column()
col = split.column()
col.prop(group, "dupli_offset", text="") col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor") prop = col.operator("wm.context_set_value", text="From Cursor")
@ -190,14 +169,12 @@ class OBJECT_PT_display(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(ob, "max_draw_type", text="Type") col.prop(ob, "max_draw_type", text="Type")
if wide_ui: col = split.column()
col = split.column()
row = col.row() row = col.row()
row.prop(ob, "draw_bounds", text="Bounds") row.prop(ob, "draw_bounds", text="Bounds")
sub = row.row() sub = row.row()
@ -212,8 +189,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, bpy.types.Panel):
col.prop(ob, "draw_wire", text="Wire") col.prop(ob, "draw_wire", text="Wire")
col.prop(ob, "color", text="Object Color") col.prop(ob, "color", text="Object Color")
if wide_ui: col = split.column()
col = split.column()
col.prop(ob, "draw_texture_space", text="Texture Space") col.prop(ob, "draw_texture_space", text="Texture Space")
col.prop(ob, "x_ray", text="X-Ray") col.prop(ob, "x_ray", text="X-Ray")
col.prop(ob, "draw_transparent", text="Transparency") col.prop(ob, "draw_transparent", text="Transparency")
@ -226,12 +202,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(ob, "dupli_type", expand=True)
layout.prop(ob, "dupli_type", expand=True)
else:
layout.prop(ob, "dupli_type", text="")
if ob.dupli_type == 'FRAMES': if ob.dupli_type == 'FRAMES':
split = layout.split() split = layout.split()
@ -240,8 +212,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel):
col.prop(ob, "dupli_frames_start", text="Start") col.prop(ob, "dupli_frames_start", text="Start")
col.prop(ob, "dupli_frames_end", text="End") col.prop(ob, "dupli_frames_end", text="End")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.prop(ob, "dupli_frames_on", text="On") col.prop(ob, "dupli_frames_on", text="On")
col.prop(ob, "dupli_frames_off", text="Off") col.prop(ob, "dupli_frames_off", text="Off")
@ -256,15 +227,12 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(ob, "use_dupli_faces_scale", text="Scale") col.prop(ob, "use_dupli_faces_scale", text="Scale")
if wide_ui: col = split.column()
col = split.column()
col.prop(ob, "dupli_faces_scale", text="Inherit Scale") col.prop(ob, "dupli_faces_scale", text="Inherit Scale")
elif ob.dupli_type == 'GROUP': elif ob.dupli_type == 'GROUP':
if wide_ui: layout.prop(ob, "dupli_group", text="Group")
layout.prop(ob, "dupli_group", text="Group")
else:
layout.prop(ob, "dupli_group", text="")
# XXX: the following options are all quite buggy, ancient hacks that should be dropped # XXX: the following options are all quite buggy, ancient hacks that should be dropped
@ -276,7 +244,6 @@ class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -295,8 +262,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel):
col.prop(ob, "time_offset", text="Offset") col.prop(ob, "time_offset", text="Offset")
# XXX: these are still used for a few curve-related tracking features # XXX: these are still used for a few curve-related tracking features
if wide_ui: col = split.column()
col = split.column()
col.label(text="Tracking Axes:") col.label(text="Tracking Axes:")
col.prop(ob, "track_axis", text="Axis") col.prop(ob, "track_axis", text="Axis")
col.prop(ob, "up_axis", text="Up Axis") col.prop(ob, "up_axis", text="Up Axis")
@ -316,9 +282,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui) self.draw_settings(context, ob.animation_visualisation)
layout.separator() layout.separator()
@ -327,8 +292,7 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.operator("object.paths_calculate", text="Calculate Paths") col.operator("object.paths_calculate", text="Calculate Paths")
if wide_ui: col = split.column()
col = split.column()
col.operator("object.paths_clear", text="Clear Paths") col.operator("object.paths_clear", text="Clear Paths")
@ -344,9 +308,8 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # in
layout = self.layout layout = self.layout
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
self.draw_settings(context, ob.animation_visualisation, wide_ui) self.draw_settings(context, ob.animation_visualisation)
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel): class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, bpy.types.Panel):
_context_path = "object" _context_path = "object"

@ -19,9 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
narrowcon = 260
class ConstraintButtonsPanel(): class ConstraintButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -31,52 +28,38 @@ class ConstraintButtonsPanel():
def draw_constraint(self, context, con): def draw_constraint(self, context, con):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui box = layout.template_constraint(con)
compact_con = context.region.width < narrowcon
box = layout.template_constraint(con, compact=compact_con)
if box: if box:
# match enum type to our functions, avoids a lookup table. # match enum type to our functions, avoids a lookup table.
getattr(self, con.type)(context, box, con, wide_ui) getattr(self, con.type)(context, box, con)
if con.type not in ('RIGID_BODY_JOINT', 'NULL'): if con.type not in ('RIGID_BODY_JOINT', 'NULL'):
box.prop(con, "influence") box.prop(con, "influence")
def space_template(self, layout, con, wide_ui, target=True, owner=True): def space_template(self, layout, con, target=True, owner=True):
if target or owner: if target or owner:
split = layout.split(percentage=0.2) split = layout.split(percentage=0.2)
if wide_ui: split.label(text="Space:")
split.label(text="Space:") row = split.row()
row = split.row()
else:
row = layout.row()
if target: if target:
row.prop(con, "target_space", text="") row.prop(con, "target_space", text="")
if wide_ui: if target and owner:
if target and owner: row.label(icon='ARROW_LEFTRIGHT')
row.label(icon='ARROW_LEFTRIGHT')
else:
row = layout.row()
if owner: if owner:
row.prop(con, "owner_space", text="") row.prop(con, "owner_space", text="")
def target_template(self, layout, con, wide_ui, subtargets=True): def target_template(self, layout, con, subtargets=True):
if wide_ui: layout.prop(con, "target") # XXX limiting settings for only 'curves' or some type of object
layout.prop(con, "target") # XXX limiting settings for only 'curves' or some type of object
else:
layout.prop(con, "target", text="")
if con.target and subtargets: if con.target and subtargets:
if con.target.type == 'ARMATURE': if con.target.type == 'ARMATURE':
if wide_ui: layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone")
layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone")
else:
layout.prop_object(con, "subtarget", con.target.data, "bones", text="")
if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO', 'PIVOT'): if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO', 'PIVOT'):
row = layout.row() row = layout.row()
@ -85,7 +68,7 @@ class ConstraintButtonsPanel():
elif con.target.type in ('MESH', 'LATTICE'): elif con.target.type in ('MESH', 'LATTICE'):
layout.prop_object(con, "subtarget", con.target, "vertex_groups", text="Vertex Group") layout.prop_object(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def ik_template(self, layout, con, wide_ui): def ik_template(self, layout, con):
# only used for iTaSC # only used for iTaSC
layout.prop(con, "pole_target") layout.prop(con, "pole_target")
@ -106,8 +89,8 @@ class ConstraintButtonsPanel():
col.prop(con, "chain_length") col.prop(con, "chain_length")
col.prop(con, "use_target") col.prop(con, "use_target")
def CHILD_OF(self, context, layout, con, wide_ui): def CHILD_OF(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
@ -134,16 +117,14 @@ class ConstraintButtonsPanel():
col = split.column() col = split.column()
col.operator("constraint.childof_set_inverse") col.operator("constraint.childof_set_inverse")
if wide_ui: col = split.column()
col = split.column()
col.operator("constraint.childof_clear_inverse") col.operator("constraint.childof_clear_inverse")
def TRACK_TO(self, context, layout, con, wide_ui): def TRACK_TO(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
row = layout.row() row = layout.row()
if wide_ui: row.label(text="To:")
row.label(text="To:")
row.prop(con, "track", expand=True) row.prop(con, "track", expand=True)
split = layout.split() split = layout.split()
@ -151,34 +132,27 @@ class ConstraintButtonsPanel():
col = split.column() col = split.column()
col.prop(con, "up", text="Up") col.prop(con, "up", text="Up")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "target_z") col.prop(con, "target_z")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def IK(self, context, layout, con, wide_ui): def IK(self, context, layout, con):
if context.object.pose.ik_solver == "ITASC": if context.object.pose.ik_solver == "ITASC":
layout.prop(con, "ik_type") layout.prop(con, "ik_type")
getattr(self, 'IK_' + con.ik_type)(context, layout, con, wide_ui) getattr(self, 'IK_' + con.ik_type)(context, layout, con)
else: else:
# Legacy IK constraint # Legacy IK constraint
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
if wide_ui: layout.prop(con, "pole_target")
layout.prop(con, "pole_target")
else:
layout.prop(con, "pole_target", text="")
if con.pole_target and con.pole_target.type == 'ARMATURE': if con.pole_target and con.pole_target.type == 'ARMATURE':
if wide_ui: layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
else:
layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="")
if con.pole_target: if con.pole_target:
row = layout.row() row = layout.row()
row.prop(con, "pole_angle") row.prop(con, "pole_angle")
if wide_ui: row.label()
row.label()
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -191,17 +165,16 @@ class ConstraintButtonsPanel():
sub.active = con.use_rotation sub.active = con.use_rotation
sub.prop(con, "orient_weight", text="Rotation", slider=True) sub.prop(con, "orient_weight", text="Rotation", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_tail") col.prop(con, "use_tail")
col.prop(con, "use_stretch") col.prop(con, "use_stretch")
col.separator() col.separator()
col.prop(con, "use_target") col.prop(con, "use_target")
col.prop(con, "use_rotation") col.prop(con, "use_rotation")
def IK_COPY_POSE(self, context, layout, con, wide_ui): def IK_COPY_POSE(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
self.ik_template(layout, con, wide_ui) self.ik_template(layout, con)
row = layout.row() row = layout.row()
row.label(text="Axis Ref:") row.label(text="Axis Ref:")
@ -234,17 +207,17 @@ class ConstraintButtonsPanel():
row.prop(con, "rot_lock_z", text="Z") row.prop(con, "rot_lock_z", text="Z")
split.active = con.use_rotation split.active = con.use_rotation
def IK_DISTANCE(self, context, layout, con, wide_ui): def IK_DISTANCE(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
self.ik_template(layout, con, wide_ui) self.ik_template(layout, con)
layout.prop(con, "limit_mode") layout.prop(con, "limit_mode")
row = layout.row() row = layout.row()
row.prop(con, "weight", text="Weight", slider=True) row.prop(con, "weight", text="Weight", slider=True)
row.prop(con, "distance", text="Distance", slider=True) row.prop(con, "distance", text="Distance", slider=True)
def FOLLOW_PATH(self, context, layout, con, wide_ui): def FOLLOW_PATH(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
@ -252,8 +225,7 @@ class ConstraintButtonsPanel():
col.prop(con, "use_curve_follow") col.prop(con, "use_curve_follow")
col.prop(con, "use_curve_radius") col.prop(con, "use_curve_radius")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_fixed_position") col.prop(con, "use_fixed_position")
if con.use_fixed_position: if con.use_fixed_position:
col.prop(con, "offset_factor", text="Offset") col.prop(con, "offset_factor", text="Offset")
@ -261,16 +233,14 @@ class ConstraintButtonsPanel():
col.prop(con, "offset") col.prop(con, "offset")
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Forward:")
row.label(text="Forward:")
row.prop(con, "forward", expand=True) row.prop(con, "forward", expand=True)
row = layout.row() row = layout.row()
row.prop(con, "up", text="Up") row.prop(con, "up", text="Up")
if wide_ui: row.label()
row.label()
def LIMIT_ROTATION(self, context, layout, con, wide_ui): def LIMIT_ROTATION(self, context, layout, con):
split = layout.split() split = layout.split()
@ -281,16 +251,14 @@ class ConstraintButtonsPanel():
sub.prop(con, "minimum_x", text="Min") sub.prop(con, "minimum_x", text="Min")
sub.prop(con, "maximum_x", text="Max") sub.prop(con, "maximum_x", text="Max")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.prop(con, "use_limit_y") col.prop(con, "use_limit_y")
sub = col.column() sub = col.column()
sub.active = con.use_limit_y sub.active = con.use_limit_y
sub.prop(con, "minimum_y", text="Min") sub.prop(con, "minimum_y", text="Min")
sub.prop(con, "maximum_y", text="Max") sub.prop(con, "maximum_y", text="Max")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.prop(con, "use_limit_z") col.prop(con, "use_limit_z")
sub = col.column() sub = col.column()
sub.active = con.use_limit_z sub.active = con.use_limit_z
@ -299,15 +267,13 @@ class ConstraintButtonsPanel():
row = layout.row() row = layout.row()
row.prop(con, "limit_transform") row.prop(con, "limit_transform")
if wide_ui: row.label()
row.label()
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Convert:")
row.label(text="Convert:")
row.prop(con, "owner_space", text="") row.prop(con, "owner_space", text="")
def LIMIT_LOCATION(self, context, layout, con, wide_ui): def LIMIT_LOCATION(self, context, layout, con):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -320,8 +286,7 @@ class ConstraintButtonsPanel():
sub.active = con.use_maximum_x sub.active = con.use_maximum_x
sub.prop(con, "maximum_x", text="") sub.prop(con, "maximum_x", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_minimum_y") col.prop(con, "use_minimum_y")
sub = col.column() sub = col.column()
sub.active = con.use_minimum_y sub.active = con.use_minimum_y
@ -331,8 +296,7 @@ class ConstraintButtonsPanel():
sub.active = con.use_maximum_y sub.active = con.use_maximum_y
sub.prop(con, "maximum_y", text="") sub.prop(con, "maximum_y", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_minimum_z") col.prop(con, "use_minimum_z")
sub = col.column() sub = col.column()
sub.active = con.use_minimum_z sub.active = con.use_minimum_z
@ -344,15 +308,13 @@ class ConstraintButtonsPanel():
row = layout.row() row = layout.row()
row.prop(con, "limit_transform") row.prop(con, "limit_transform")
if wide_ui: row.label()
row.label()
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Convert:")
row.label(text="Convert:")
row.prop(con, "owner_space", text="") row.prop(con, "owner_space", text="")
def LIMIT_SCALE(self, context, layout, con, wide_ui): def LIMIT_SCALE(self, context, layout, con):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -365,8 +327,7 @@ class ConstraintButtonsPanel():
sub.active = con.use_maximum_x sub.active = con.use_maximum_x
sub.prop(con, "maximum_x", text="") sub.prop(con, "maximum_x", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_minimum_y") col.prop(con, "use_minimum_y")
sub = col.column() sub = col.column()
sub.active = con.use_minimum_y sub.active = con.use_minimum_y
@ -376,8 +337,7 @@ class ConstraintButtonsPanel():
sub.active = con.use_maximum_y sub.active = con.use_maximum_y
sub.prop(con, "maximum_y", text="") sub.prop(con, "maximum_y", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_minimum_z") col.prop(con, "use_minimum_z")
sub = col.column() sub = col.column()
sub.active = con.use_minimum_z sub.active = con.use_minimum_z
@ -389,16 +349,14 @@ class ConstraintButtonsPanel():
row = layout.row() row = layout.row()
row.prop(con, "limit_transform") row.prop(con, "limit_transform")
if wide_ui: row.label()
row.label()
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Convert:")
row.label(text="Convert:")
row.prop(con, "owner_space", text="") row.prop(con, "owner_space", text="")
def COPY_ROTATION(self, context, layout, con, wide_ui): def COPY_ROTATION(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
@ -422,10 +380,10 @@ class ConstraintButtonsPanel():
layout.prop(con, "use_offset") layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def COPY_LOCATION(self, context, layout, con, wide_ui): def COPY_LOCATION(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
@ -449,10 +407,10 @@ class ConstraintButtonsPanel():
layout.prop(con, "use_offset") layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def COPY_SCALE(self, context, layout, con, wide_ui): def COPY_SCALE(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
row = layout.row(align=True) row = layout.row(align=True)
row.prop(con, "use_x", text="X") row.prop(con, "use_x", text="X")
@ -461,38 +419,31 @@ class ConstraintButtonsPanel():
layout.prop(con, "use_offset") layout.prop(con, "use_offset")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def MAINTAIN_VOLUME(self, context, layout, con, wide_ui): def MAINTAIN_VOLUME(self, context, layout, con):
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Free:")
row.label(text="Free:")
row.prop(con, "axis", expand=True) row.prop(con, "axis", expand=True)
layout.prop(con, "volume") layout.prop(con, "volume")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def COPY_TRANSFORMS(self, context, layout, con, wide_ui): def COPY_TRANSFORMS(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
#def SCRIPT(self, context, layout, con): #def SCRIPT(self, context, layout, con):
def ACTION(self, context, layout, con, wide_ui): def ACTION(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
if wide_ui: layout.prop(con, "action")
layout.prop(con, "action")
else:
layout.prop(con, "action", text="")
if wide_ui: layout.prop(con, "transform_channel")
layout.prop(con, "transform_channel")
else:
layout.prop(con, "transform_channel", text="")
split = layout.split() split = layout.split()
@ -501,32 +452,28 @@ class ConstraintButtonsPanel():
col.prop(con, "frame_start", text="Start") col.prop(con, "frame_start", text="Start")
col.prop(con, "frame_end", text="End") col.prop(con, "frame_end", text="End")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Target Range:") col.label(text="Target Range:")
col.prop(con, "minimum", text="Min") col.prop(con, "minimum", text="Min")
col.prop(con, "maximum", text="Max") col.prop(con, "maximum", text="Max")
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Convert:")
row.label(text="Convert:")
row.prop(con, "target_space", text="") row.prop(con, "target_space", text="")
def LOCKED_TRACK(self, context, layout, con, wide_ui): def LOCKED_TRACK(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
row = layout.row() row = layout.row()
if wide_ui: row.label(text="To:")
row.label(text="To:")
row.prop(con, "track", expand=True) row.prop(con, "track", expand=True)
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Lock:")
row.label(text="Lock:")
row.prop(con, "lock", expand=True) row.prop(con, "lock", expand=True)
def LIMIT_DISTANCE(self, context, layout, con, wide_ui): def LIMIT_DISTANCE(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
col = layout.column(align=True) col = layout.column(align=True)
col.prop(con, "distance") col.prop(con, "distance")
@ -536,70 +483,58 @@ class ConstraintButtonsPanel():
row.label(text="Clamp Region:") row.label(text="Clamp Region:")
row.prop(con, "limit_mode", text="") row.prop(con, "limit_mode", text="")
def STRETCH_TO(self, context, layout, con, wide_ui): def STRETCH_TO(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(con, "original_length", text="Rest Length") col.prop(con, "original_length", text="Rest Length")
if wide_ui: col = split.column()
col = split.column()
col.operator("constraint.stretchto_reset", text="Reset") col.operator("constraint.stretchto_reset", text="Reset")
col = layout.column() col = layout.column()
col.prop(con, "bulge", text="Volume Variation") col.prop(con, "bulge", text="Volume Variation")
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Volume:")
row.label(text="Volume:")
row.prop(con, "volume", expand=True) row.prop(con, "volume", expand=True)
if not wide_ui:
row = layout.row()
row.label(text="Plane:") row.label(text="Plane:")
row.prop(con, "keep_axis", expand=True) row.prop(con, "keep_axis", expand=True)
def FLOOR(self, context, layout, con, wide_ui): def FLOOR(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(con, "sticky") col.prop(con, "sticky")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "use_rotation") col.prop(con, "use_rotation")
layout.prop(con, "offset") layout.prop(con, "offset")
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Min/Max:")
row.label(text="Min/Max:")
row.prop(con, "floor_location", expand=True) row.prop(con, "floor_location", expand=True)
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def RIGID_BODY_JOINT(self, context, layout, con, wide_ui): def RIGID_BODY_JOINT(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
if wide_ui: layout.prop(con, "pivot_type")
layout.prop(con, "pivot_type") layout.prop(con, "child")
else:
layout.prop(con, "pivot_type", text="")
if wide_ui:
layout.prop(con, "child")
else:
layout.prop(con, "child", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(con, "disable_linked_collision", text="No Collision") col.prop(con, "disable_linked_collision", text="No Collision")
if wide_ui: col = split.column()
col = split.column()
col.prop(con, "draw_pivot", text="Display Pivot") col.prop(con, "draw_pivot", text="Display Pivot")
split = layout.split() split = layout.split()
@ -610,8 +545,7 @@ class ConstraintButtonsPanel():
col.prop(con, "pivot_y", text="Y") col.prop(con, "pivot_y", text="Y")
col.prop(con, "pivot_z", text="Z") col.prop(con, "pivot_z", text="Z")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Axis:") col.label(text="Axis:")
col.prop(con, "axis_x", text="X") col.prop(con, "axis_x", text="X")
col.prop(con, "axis_y", text="Y") col.prop(con, "axis_y", text="Y")
@ -619,19 +553,18 @@ class ConstraintButtonsPanel():
#Missing: Limit arrays (not wrapped in RNA yet) #Missing: Limit arrays (not wrapped in RNA yet)
def CLAMP_TO(self, context, layout, con, wide_ui): def CLAMP_TO(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
row = layout.row() row = layout.row()
if wide_ui: row.label(text="Main Axis:")
row.label(text="Main Axis:")
row.prop(con, "main_axis", expand=True) row.prop(con, "main_axis", expand=True)
row = layout.row() row = layout.row()
row.prop(con, "cyclic") row.prop(con, "cyclic")
def TRANSFORM(self, context, layout, con, wide_ui): def TRANSFORM(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
layout.prop(con, "extrapolate_motion", text="Extrapolate") layout.prop(con, "extrapolate_motion", text="Extrapolate")
@ -646,14 +579,12 @@ class ConstraintButtonsPanel():
sub.prop(con, "from_min_x", text="Min") sub.prop(con, "from_min_x", text="Min")
sub.prop(con, "from_max_x", text="Max") sub.prop(con, "from_max_x", text="Max")
if wide_ui: sub = split.column(align=True)
sub = split.column(align=True)
sub.label(text="Y:") sub.label(text="Y:")
sub.prop(con, "from_min_y", text="Min") sub.prop(con, "from_min_y", text="Min")
sub.prop(con, "from_max_y", text="Max") sub.prop(con, "from_max_y", text="Max")
if wide_ui: sub = split.column(align=True)
sub = split.column(align=True)
sub.label(text="Z:") sub.label(text="Z:")
sub.prop(con, "from_min_z", text="Min") sub.prop(con, "from_min_z", text="Min")
sub.prop(con, "from_max_z", text="Max") sub.prop(con, "from_max_z", text="Max")
@ -674,8 +605,7 @@ class ConstraintButtonsPanel():
sub.prop(con, "to_min_x", text="Min") sub.prop(con, "to_min_x", text="Min")
sub.prop(con, "to_max_x", text="Max") sub.prop(con, "to_max_x", text="Max")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Y:") col.label(text="Y:")
col.row().prop(con, "map_to_y_from", expand=True) col.row().prop(con, "map_to_y_from", expand=True)
@ -683,8 +613,7 @@ class ConstraintButtonsPanel():
sub.prop(con, "to_min_y", text="Min") sub.prop(con, "to_min_y", text="Min")
sub.prop(con, "to_max_y", text="Max") sub.prop(con, "to_max_y", text="Max")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Z:") col.label(text="Z:")
col.row().prop(con, "map_to_z_from", expand=True) col.row().prop(con, "map_to_z_from", expand=True)
@ -692,10 +621,10 @@ class ConstraintButtonsPanel():
sub.prop(con, "to_min_z", text="Min") sub.prop(con, "to_min_z", text="Min")
sub.prop(con, "to_max_z", text="Max") sub.prop(con, "to_max_z", text="Max")
self.space_template(layout, con, wide_ui) self.space_template(layout, con)
def SHRINKWRAP(self, context, layout, con, wide_ui): def SHRINKWRAP(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
layout.prop(con, "distance") layout.prop(con, "distance")
layout.prop(con, "shrinkwrap_type") layout.prop(con, "shrinkwrap_type")
@ -706,16 +635,15 @@ class ConstraintButtonsPanel():
row.prop(con, "use_y") row.prop(con, "use_y")
row.prop(con, "use_z") row.prop(con, "use_z")
def DAMPED_TRACK(self, context, layout, con, wide_ui): def DAMPED_TRACK(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
row = layout.row() row = layout.row()
if wide_ui: row.label(text="To:")
row.label(text="To:")
row.prop(con, "track", expand=True) row.prop(con, "track", expand=True)
def SPLINE_IK(self, context, layout, con, wide_ui): def SPLINE_IK(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
col = layout.column() col = layout.column()
col.label(text="Spline Fitting:") col.label(text="Spline Fitting:")
@ -726,14 +654,11 @@ class ConstraintButtonsPanel():
col = layout.column() col = layout.column()
col.label(text="Chain Scaling:") col.label(text="Chain Scaling:")
col.prop(con, "y_stretch") col.prop(con, "y_stretch")
if wide_ui: col.prop(con, "xz_scaling_mode")
col.prop(con, "xz_scaling_mode")
else:
col.prop(con, "xz_scaling_mode", text="")
col.prop(con, "use_curve_radius") col.prop(con, "use_curve_radius")
def PIVOT(self, context, layout, con, wide_ui): def PIVOT(self, context, layout, con):
self.target_template(layout, con, wide_ui) self.target_template(layout, con)
if con.target: if con.target:
col = layout.column() col = layout.column()

@ -25,8 +25,6 @@ from properties_physics_common import effector_weights_ui
from properties_physics_common import basic_force_field_settings_ui from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui from properties_physics_common import basic_force_field_falloff_ui
narrowui = bpy.context.user_preferences.view.properties_width_check
def particle_panel_enabled(context, psys): def particle_panel_enabled(context, psys):
return (psys.point_cache.baked is False) and (not psys.edited) and (not context.particle_system_editable) return (psys.point_cache.baked is False) and (not psys.edited) and (not context.particle_system_editable)
@ -159,7 +157,6 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches
@ -181,10 +178,8 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
layout.row().label(text="Emit From:") layout.row().label(text="Emit From:")
row = layout.row() row = layout.row()
if wide_ui: row.prop(part, "emit_from", expand=True)
row.prop(part, "emit_from", expand=True)
else:
row.prop(part, "emit_from", text="")
row = layout.row() row = layout.row()
row.prop(part, "trand") row.prop(part, "trand")
if part.distribution != 'GRID': if part.distribution != 'GRID':
@ -192,10 +187,8 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME': if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
row = layout.row() row = layout.row()
if wide_ui:
row.prop(part, "distribution", expand=True) row.prop(part, "distribution", expand=True)
else:
row.prop(part, "distribution", text="")
row = layout.row() row = layout.row()
@ -353,7 +346,6 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
layout.enabled = particle_panel_enabled(context, psys) layout.enabled = particle_panel_enabled(context, psys)
@ -371,10 +363,7 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel):
sub.prop(part, "random_phase_factor", text="Random", slider=True) sub.prop(part, "random_phase_factor", text="Random", slider=True)
layout.row().label(text="Angular Velocity:") layout.row().label(text="Angular Velocity:")
if wide_ui: layout.row().prop(part, "angular_velocity_mode", expand=True)
layout.row().prop(part, "angular_velocity_mode", expand=True)
else:
layout.row().prop(part, "angular_velocity_mode", text="")
split = layout.split() split = layout.split()
sub = split.column() sub = split.column()
@ -399,15 +388,11 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
layout.enabled = particle_panel_enabled(context, psys) layout.enabled = particle_panel_enabled(context, psys)
row = layout.row() row = layout.row()
if wide_ui: row.prop(part, "physics_type", expand=True)
row.prop(part, "physics_type", expand=True)
else:
row.prop(part, "physics_type", text="")
row = layout.row() row = layout.row()
col = row.column(align=True) col = row.column(align=True)
@ -701,7 +686,6 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.prop(part, "material") row.prop(part, "material")
@ -717,10 +701,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
sub.prop(part, "died") sub.prop(part, "died")
row = layout.row() row = layout.row()
if wide_ui: row.prop(part, "ren_as", expand=True)
row.prop(part, "ren_as", expand=True)
else:
row.prop(part, "ren_as", text="")
split = layout.split() split = layout.split()
@ -807,10 +788,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
sub.label(text="Align:") sub.label(text="Align:")
row = layout.row() row = layout.row()
if wide_ui: row.prop(part, "billboard_align", expand=True)
row.prop(part, "billboard_align", expand=True)
else:
row.prop(part, "billboard_align", text="")
row.prop(part, "billboard_lock", text="Lock") row.prop(part, "billboard_lock", text="Lock")
row = layout.row() row = layout.row()
row.prop(part, "billboard_object") row.prop(part, "billboard_object")
@ -873,13 +851,9 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
if wide_ui: row.prop(part, "draw_as", expand=True)
row.prop(part, "draw_as", expand=True)
else:
row.prop(part, "draw_as", text="")
if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'): if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'):
return return
@ -927,12 +901,8 @@ class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel):
psys = context.particle_system psys = context.particle_system
part = psys.settings part = psys.settings
wide_ui = context.region.width > narrowui
if wide_ui: layout.row().prop(part, "child_type", expand=True)
layout.row().prop(part, "child_type", expand=True)
else:
layout.row().prop(part, "child_type", text="")
if part.child_type == 'NONE': if part.child_type == 'NONE':
return return
@ -988,10 +958,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel):
col.label(text="hair parting controls") col.label(text="hair parting controls")
layout.row().label(text="Kink:") layout.row().label(text="Kink:")
if wide_ui: layout.row().prop(part, "kink", expand=True)
layout.row().prop(part, "kink", expand=True)
else:
layout.row().prop(part, "kink", text="")
split = layout.split() split = layout.split()

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui from properties_physics_common import effector_weights_ui
@ -60,7 +58,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel):
md = context.cloth md = context.cloth
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -75,8 +72,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel):
else: else:
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'CLOTH' split.operator("object.modifier_add", text="Add").type = 'CLOTH'
if wide_ui: split.label()
split.label()
if md: if md:
cloth = md.settings cloth = md.settings
@ -100,8 +96,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel):
col.prop(cloth, "structural_stiffness", text="Structural") col.prop(cloth, "structural_stiffness", text="Structural")
col.prop(cloth, "bending_stiffness", text="Bending") col.prop(cloth, "bending_stiffness", text="Bending")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Damping:") col.label(text="Damping:")
col.prop(cloth, "spring_damping", text="Spring") col.prop(cloth, "spring_damping", text="Spring")
@ -166,7 +161,6 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, bpy.types.Panel):
cloth = context.cloth.collision_settings cloth = context.cloth.collision_settings
md = context.cloth md = context.cloth
wide_ui = context.region.width > narrowui
layout.active = cloth.enable_collision and cloth_panel_enabled(md) layout.active = cloth.enable_collision and cloth_panel_enabled(md)
@ -177,8 +171,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, bpy.types.Panel):
col.prop(cloth, "min_distance", slider=True, text="Distance") col.prop(cloth, "min_distance", slider=True, text="Distance")
col.prop(cloth, "friction") col.prop(cloth, "friction")
if wide_ui: col = split.column()
col = split.column()
col.prop(cloth, "enable_self_collision", text="Self Collision") col.prop(cloth, "enable_self_collision", text="Self Collision")
sub = col.column() sub = col.column()
sub.active = cloth.enable_self_collision sub.active = cloth.enable_self_collision
@ -208,7 +201,6 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel):
md = context.cloth md = context.cloth
ob = context.object ob = context.object
cloth = context.cloth.settings cloth = context.cloth.settings
wide_ui = context.region.width > narrowui
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md) layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
@ -219,8 +211,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel):
col.prop_object(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="") col.prop_object(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col.prop(cloth, "structural_stiffness_max", text="Max") col.prop(cloth, "structural_stiffness_max", text="Max")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Bending Stiffness:") col.label(text="Bending Stiffness:")
col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="") col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
col.prop(cloth, "bending_stiffness_max", text="Max") col.prop(cloth, "bending_stiffness_max", text="Max")

@ -20,15 +20,12 @@
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
def point_cache_ui(self, context, cache, enabled, cachetype): def point_cache_ui(self, context, cache, enabled, cachetype):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
layout.set_context_pointer("point_cache", cache) layout.set_context_pointer("point_cache", cache)
row = layout.row() row = layout.row()
@ -66,8 +63,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
if cachetype != 'SMOKE': if cachetype != 'SMOKE':
col.prop(cache, "step") col.prop(cache, "step")
if wide_ui: col = split.column()
col = split.column()
if cachetype != 'SMOKE': if cachetype != 'SMOKE':
sub = col.column() sub = col.column()
@ -102,8 +98,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake") sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake")
if wide_ui: col = split.column()
col = split.column()
col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
col.operator("ptcache.free_bake_all", text="Free All Bakes") col.operator("ptcache.free_bake_all", text="Free All Bakes")
col.operator("ptcache.bake_all", text="Update All To Frame").bake = False col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
@ -112,7 +107,6 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
def effector_weights_ui(self, context, weights): def effector_weights_ui(self, context, weights):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
layout.prop(weights, "group") layout.prop(weights, "group")
@ -121,8 +115,7 @@ def effector_weights_ui(self, context, weights):
col = split.column() col = split.column()
col.prop(weights, "gravity", slider=True) col.prop(weights, "gravity", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(weights, "all", slider=True) col.prop(weights, "all", slider=True)
layout.separator() layout.separator()
@ -137,8 +130,7 @@ def effector_weights_ui(self, context, weights):
col.prop(weights, "curveguide", slider=True) col.prop(weights, "curveguide", slider=True)
col.prop(weights, "texture", slider=True) col.prop(weights, "texture", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(weights, "harmonic", slider=True) col.prop(weights, "harmonic", slider=True)
col.prop(weights, "charge", slider=True) col.prop(weights, "charge", slider=True)
col.prop(weights, "lennardjones", slider=True) col.prop(weights, "lennardjones", slider=True)
@ -150,7 +142,6 @@ def effector_weights_ui(self, context, weights):
def basic_force_field_settings_ui(self, context, field): def basic_force_field_settings_ui(self, context, field):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -177,8 +168,7 @@ def basic_force_field_settings_ui(self, context, field):
else: else:
col.prop(field, "flow") col.prop(field, "flow")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "noise") col.prop(field, "noise")
col.prop(field, "seed") col.prop(field, "seed")
if field.type == 'TURBULENCE': if field.type == 'TURBULENCE':
@ -193,8 +183,7 @@ def basic_force_field_settings_ui(self, context, field):
col.prop(field, "do_location") col.prop(field, "do_location")
col.prop(field, "do_rotation") col.prop(field, "do_rotation")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Collision:") col.label(text="Collision:")
col.prop(field, "do_absorption") col.prop(field, "do_absorption")
@ -202,12 +191,9 @@ def basic_force_field_settings_ui(self, context, field):
def basic_force_field_falloff_ui(self, context, field): def basic_force_field_falloff_ui(self, context, field):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
# XXX: This doesn't update for some reason. # XXX: This doesn't update for some reason.
#if wide_ui: #split = layout.split()
# split = layout.split()
#else:
split = layout.split(percentage=0.35) split = layout.split(percentage=0.35)
if not field or field.type == 'NONE': if not field or field.type == 'NONE':
@ -218,8 +204,7 @@ def basic_force_field_falloff_ui(self, context, field):
col.prop(field, "use_min_distance", text="Use Minimum") col.prop(field, "use_min_distance", text="Use Minimum")
col.prop(field, "use_max_distance", text="Use Maximum") col.prop(field, "use_max_distance", text="Use Maximum")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "falloff_power", text="Power") col.prop(field, "falloff_power", text="Power")
sub = col.column() sub = col.column()

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import basic_force_field_settings_ui from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui from properties_physics_common import basic_force_field_falloff_ui
@ -45,22 +43,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
ob = context.object ob = context.object
field = ob.field field = ob.field
wide_ui = context.region.width > narrowui
if wide_ui: split = layout.split(percentage=0.2)
split = layout.split(percentage=0.2) split.label(text="Type:")
split.label(text="Type:")
else:
split = layout.split()
split.prop(field, "type", text="") split.prop(field, "type", text="")
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'): if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
if wide_ui: split = layout.split(percentage=0.2)
split = layout.split(percentage=0.2) split.label(text="Shape:")
split.label(text="Shape:")
else:
split = layout.split()
split.prop(field, "shape", text="") split.prop(field, "shape", text="")
split = layout.split() split = layout.split()
@ -75,8 +66,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
col.prop(field, "guide_path_add") col.prop(field, "guide_path_add")
col.prop(field, "use_guide_path_weight") col.prop(field, "use_guide_path_weight")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Clumping:") col.label(text="Clumping:")
col.prop(field, "guide_clump_amount") col.prop(field, "guide_clump_amount")
col.prop(field, "guide_clump_shape") col.prop(field, "guide_clump_shape")
@ -99,8 +89,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
col.prop(field, "guide_kink_frequency") col.prop(field, "guide_kink_frequency")
col.prop(field, "guide_kink_shape") col.prop(field, "guide_kink_shape")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "guide_kink_amplitude") col.prop(field, "guide_kink_amplitude")
elif field.type == 'TEXTURE': elif field.type == 'TEXTURE':
@ -110,8 +99,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
col.prop(field, "texture_mode", text="") col.prop(field, "texture_mode", text="")
col.prop(field, "texture_nabla") col.prop(field, "texture_nabla")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "use_coordinates") col.prop(field, "use_coordinates")
col.prop(field, "root_coordinates") col.prop(field, "root_coordinates")
col.prop(field, "force_2d") col.prop(field, "force_2d")
@ -135,8 +123,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
col.prop(field, "use_radial_min", text="Use Minimum") col.prop(field, "use_radial_min", text="Use Minimum")
col.prop(field, "use_radial_max", text="Use Maximum") col.prop(field, "use_radial_max", text="Use Maximum")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "radial_falloff", text="Power") col.prop(field, "radial_falloff", text="Power")
sub = col.column() sub = col.column()
@ -157,8 +144,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel):
col.prop(field, "use_radial_min", text="Use Minimum") col.prop(field, "use_radial_min", text="Use Minimum")
col.prop(field, "use_radial_max", text="Use Maximum") col.prop(field, "use_radial_max", text="Use Maximum")
if wide_ui: col = split.column()
col = split.column()
col.prop(field, "radial_falloff", text="Power") col.prop(field, "radial_falloff", text="Power")
sub = col.column() sub = col.column()
@ -184,7 +170,6 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
md = context.collision md = context.collision
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -192,8 +177,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
# remove modifier + settings # remove modifier + settings
split.set_context_pointer("modifier", md) split.set_context_pointer("modifier", md)
split.operator("object.modifier_remove", text="Remove") split.operator("object.modifier_remove", text="Remove")
if wide_ui: col = split.column()
col = split.column()
#row = split.row(align=True) #row = split.row(align=True)
#row.prop(md, "render", text="") #row.prop(md, "render", text="")
@ -204,8 +188,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
else: else:
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'COLLISION' split.operator("object.modifier_add", text="Add").type = 'COLLISION'
if wide_ui: split.label()
split.label()
coll = None coll = None
@ -231,8 +214,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel):
sub.prop(settings, "friction_factor", text="Factor", slider=True) sub.prop(settings, "friction_factor", text="Factor", slider=True)
sub.prop(settings, "random_friction", text="Random", slider=True) sub.prop(settings, "random_friction", text="Random", slider=True)
if wide_ui: col = split.column()
col = split.column()
col.label(text="Soft Body and Cloth:") col.label(text="Soft Body and Cloth:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(settings, "outer_thickness", text="Outer", slider=True) sub.prop(settings, "outer_thickness", text="Outer", slider=True)

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicButtonsPanel(): class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -41,7 +39,6 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
md = context.fluid md = context.fluid
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -59,22 +56,16 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
else: else:
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION' split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION'
if wide_ui: split.label()
split.label()
fluid = None fluid = None
if fluid: if fluid:
if wide_ui: row = layout.row()
row = layout.row() row.prop(fluid, "type")
row.prop(fluid, "type") if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): row.prop(fluid, "active", text="")
row.prop(fluid, "active", text="")
else:
layout.prop(fluid, "type", text="")
if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
layout.prop(fluid, "active", text="")
layout = layout.column() layout = layout.column()
if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'):
@ -90,8 +81,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.label(text="Render Display:") col.label(text="Render Display:")
col.prop(fluid, "render_display_mode", text="") col.prop(fluid, "render_display_mode", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Required Memory: " + fluid.memory_estimate) col.label(text="Required Memory: " + fluid.memory_estimate)
col.prop(fluid, "preview_resolution", text="Preview") col.prop(fluid, "preview_resolution", text="Preview")
col.label(text="Viewport Display:") col.label(text="Viewport Display:")
@ -105,9 +95,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
sub.prop(fluid, "start_time", text="Start") sub.prop(fluid, "start_time", text="Start")
sub.prop(fluid, "end_time", text="End") sub.prop(fluid, "end_time", text="End")
if wide_ui: col = split.column()
col = split.column() col.label()
col.label()
col.prop(fluid, "generate_speed_vectors") col.prop(fluid, "generate_speed_vectors")
col.prop(fluid, "reverse_frames") col.prop(fluid, "reverse_frames")
@ -121,8 +110,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "export_animated_mesh") col.prop(fluid, "export_animated_mesh")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Initial Velocity:") col.label(text="Initial Velocity:")
col.prop(fluid, "initial_velocity", text="") col.prop(fluid, "initial_velocity", text="")
@ -134,8 +122,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "export_animated_mesh") col.prop(fluid, "export_animated_mesh")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Slip Type:") col.label(text="Slip Type:")
col.prop(fluid, "slip_type", text="") col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP': if fluid.slip_type == 'PARTIALSLIP':
@ -153,8 +140,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "export_animated_mesh") col.prop(fluid, "export_animated_mesh")
col.prop(fluid, "local_coordinates") col.prop(fluid, "local_coordinates")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Inflow Velocity:") col.label(text="Inflow Velocity:")
col.prop(fluid, "inflow_velocity", text="") col.prop(fluid, "inflow_velocity", text="")
@ -166,8 +152,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "volume_initialization", text="") col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "export_animated_mesh") col.prop(fluid, "export_animated_mesh")
if wide_ui: split.column()
split.column()
elif fluid.type == 'PARTICLE': elif fluid.type == 'PARTICLE':
split = layout.split() split = layout.split()
@ -177,8 +162,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "particle_influence", text="Size") col.prop(fluid, "particle_influence", text="Size")
col.prop(fluid, "alpha_influence", text="Alpha") col.prop(fluid, "alpha_influence", text="Alpha")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Type:") col.label(text="Type:")
col.prop(fluid, "drops") col.prop(fluid, "drops")
col.prop(fluid, "floats") col.prop(fluid, "floats")
@ -194,8 +178,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
col.prop(fluid, "quality", slider=True) col.prop(fluid, "quality", slider=True)
col.prop(fluid, "reverse_frames") col.prop(fluid, "reverse_frames")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Time:") col.label(text="Time:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(fluid, "start_time", text="Start") sub.prop(fluid, "start_time", text="Start")
@ -209,8 +192,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
sub.prop(fluid, "attraction_strength", text="Strength") sub.prop(fluid, "attraction_strength", text="Strength")
sub.prop(fluid, "attraction_radius", text="Radius") sub.prop(fluid, "attraction_radius", text="Radius")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Velocity Force:") col.label(text="Velocity Force:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(fluid, "velocity_strength", text="Strength") sub.prop(fluid, "velocity_strength", text="Strength")
@ -231,7 +213,6 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel):
fluid = context.fluid.settings fluid = context.fluid.settings
scene = context.scene scene = context.scene
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -254,8 +235,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel):
col.label(text="Real World Size:") col.label(text="Real World Size:")
col.prop(fluid, "real_world_size", text="Metres") col.prop(fluid, "real_world_size", text="Metres")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Viscosity Presets:") col.label(text="Viscosity Presets:")
sub = col.column(align=True) sub = col.column(align=True)
sub.prop(fluid, "viscosity_preset", text="") sub.prop(fluid, "viscosity_preset", text="")
@ -282,7 +262,6 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
fluid = context.fluid.settings fluid = context.fluid.settings
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -292,8 +271,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel):
if fluid.slip_type == 'PARTIALSLIP': if fluid.slip_type == 'PARTIALSLIP':
col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Surface:") col.label(text="Surface:")
col.prop(fluid, "surface_smoothing", text="Smoothing") col.prop(fluid, "surface_smoothing", text="Smoothing")
col.prop(fluid, "surface_subdivisions", text="Subdivisions") col.prop(fluid, "surface_subdivisions", text="Subdivisions")

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui from properties_physics_common import effector_weights_ui
@ -46,7 +44,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
md = context.smoke md = context.smoke
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -62,14 +59,10 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
else: else:
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'SMOKE' split.operator("object.modifier_add", text="Add").type = 'SMOKE'
if wide_ui: split.label()
split.label()
if md: if md:
if wide_ui: layout.prop(md, "smoke_type", expand=True)
layout.prop(md, "smoke_type", expand=True)
else:
layout.prop(md, "smoke_type", text="")
if md.smoke_type == 'DOMAIN': if md.smoke_type == 'DOMAIN':
domain = md.domain_settings domain = md.domain_settings
@ -84,8 +77,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
col.label(text="Border Collisions:") col.label(text="Border Collisions:")
col.prop(domain, "smoke_domain_colli", text="") col.prop(domain, "smoke_domain_colli", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Behavior:") col.label(text="Behavior:")
col.prop(domain, "alpha") col.prop(domain, "alpha")
col.prop(domain, "beta") col.prop(domain, "beta")
@ -115,8 +107,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel):
sub.active = flow.initial_velocity sub.active = flow.initial_velocity
sub.prop(flow, "velocity_multiplier", text="Multiplier") sub.prop(flow, "velocity_multiplier", text="Multiplier")
if wide_ui:
sub = split.column() sub = split.column()
sub.active = not md.flow_settings.outflow sub.active = not md.flow_settings.outflow
sub.label(text="Behavior:") sub.label(text="Behavior:")
sub.prop(flow, "temperature") sub.prop(flow, "temperature")
@ -140,7 +132,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
group = context.smoke.domain_settings group = context.smoke.domain_settings
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -151,8 +142,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel):
#col.label(text="Effector Group:") #col.label(text="Effector Group:")
#col.prop(group, "eff_group", text="") #col.prop(group, "eff_group", text="")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Collision Group:") col.label(text="Collision Group:")
col.prop(group, "coll_group", text="") col.prop(group, "coll_group", text="")
@ -196,7 +186,6 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
md = context.smoke.domain_settings md = context.smoke.domain_settings
wide_ui = context.region.width > narrowui
layout.active = md.highres layout.active = md.highres
@ -208,8 +197,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel):
col.prop(md, "smoothemitter") col.prop(md, "smoothemitter")
col.prop(md, "viewhighres") col.prop(md, "viewhighres")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Noise Method:") col.label(text="Noise Method:")
col.row().prop(md, "noise_type", text="") col.row().prop(md, "noise_type", text="")
col.prop(md, "strength") col.prop(md, "strength")

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui from properties_physics_common import effector_weights_ui
@ -52,7 +50,6 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel):
md = context.soft_body md = context.soft_body
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -67,8 +64,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel):
else: else:
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'SOFT_BODY' split.operator("object.modifier_add", text="Add").type = 'SOFT_BODY'
if wide_ui: split.column()
split.column()
if md: if md:
softbody = md.settings softbody = md.settings
@ -83,8 +79,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel):
col.prop(softbody, "mass") col.prop(softbody, "mass")
col.prop_object(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:") col.prop_object(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Simulation:") col.label(text="Simulation:")
col.prop(softbody, "speed") col.prop(softbody, "speed")
@ -122,7 +117,6 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
layout.active = softbody.use_goal and softbody_panel_enabled(md) layout.active = softbody.use_goal and softbody_panel_enabled(md)
@ -138,8 +132,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel):
sub.prop(softbody, "goal_min", text="Minimum") sub.prop(softbody, "goal_min", text="Minimum")
sub.prop(softbody, "goal_max", text="Maximum") sub.prop(softbody, "goal_max", text="Maximum")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Goal Settings:") col.label(text="Goal Settings:")
col.prop(softbody, "goal_spring", text="Stiffness") col.prop(softbody, "goal_spring", text="Stiffness")
col.prop(softbody, "goal_friction", text="Damping") col.prop(softbody, "goal_friction", text="Damping")
@ -167,7 +160,6 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
ob = context.object ob = context.object
wide_ui = context.region.width > narrowui
layout.active = softbody.use_edges and softbody_panel_enabled(md) layout.active = softbody.use_edges and softbody_panel_enabled(md)
@ -183,8 +175,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel):
col.prop(softbody, "spring_length", text="Length") col.prop(softbody, "spring_length", text="Length")
col.prop_object(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:") col.prop_object(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:")
if wide_ui: col = split.column()
col = split.column()
col.prop(softbody, "stiff_quads") col.prop(softbody, "stiff_quads")
sub = col.column() sub = col.column()
sub.active = softbody.stiff_quads sub.active = softbody.stiff_quads
@ -222,15 +213,11 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, bpy.types.Panel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
wide_ui = context.region.width > narrowui
layout.active = softbody.self_collision and softbody_panel_enabled(md) layout.active = softbody.self_collision and softbody_panel_enabled(md)
layout.label(text="Collision Ball Size Calculation:") layout.label(text="Collision Ball Size Calculation:")
if wide_ui: layout.prop(softbody, "collision_type", expand=True)
layout.prop(softbody, "collision_type", expand=True)
else:
layout.prop(softbody, "collision_type", text="")
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Ball:") col.label(text="Ball:")
@ -252,7 +239,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
wide_ui = context.region.width > narrowui
layout.active = softbody_panel_enabled(md) layout.active = softbody_panel_enabled(md)
@ -265,8 +251,7 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel):
col.prop(softbody, "maxstep") col.prop(softbody, "maxstep")
col.prop(softbody, "auto_step", text="Auto-Step") col.prop(softbody, "auto_step", text="Auto-Step")
if wide_ui: col = split.column()
col = split.column()
col.prop(softbody, "error_limit") col.prop(softbody, "error_limit")
col.label(text="Helpers:") col.label(text="Helpers:")
col.prop(softbody, "choke") col.prop(softbody, "choke")

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class RENDER_MT_presets(bpy.types.Menu): class RENDER_MT_presets(bpy.types.Menu):
bl_label = "Render Presets" bl_label = "Render Presets"
@ -56,15 +54,13 @@ class RENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.operator("render.render", text="Image", icon='RENDER_STILL') col.operator("render.render", text="Image", icon='RENDER_STILL')
if wide_ui: col = split.column()
col = split.column()
col.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True col.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
layout.prop(rd, "display_mode", text="Display") layout.prop(rd, "display_mode", text="Display")
@ -85,7 +81,6 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
scene = context.scene scene = context.scene
rd = scene.render rd = scene.render
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2) row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
@ -106,8 +101,8 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
col.label(text="") col.label(text="")
col.prop(rl, "light_override", text="Light") col.prop(rl, "light_override", text="Light")
col.prop(rl, "material_override", text="Material") col.prop(rl, "material_override", text="Material")
if wide_ui:
col = split.column() col = split.column()
col.prop(rl, "visible_layers", text="Layer") col.prop(rl, "visible_layers", text="Layer")
col.label(text="Mask Layers:") col.label(text="Mask Layers:")
col.prop(rl, "zmask_layers", text="") col.prop(rl, "zmask_layers", text="")
@ -150,8 +145,7 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel):
col.prop(rl, "pass_object_index") col.prop(rl, "pass_object_index")
col.prop(rl, "pass_color") col.prop(rl, "pass_color")
if wide_ui: col = split.column()
col = split.column()
col.label() col.label()
col.prop(rl, "pass_diffuse") col.prop(rl, "pass_diffuse")
row = col.row() row = col.row()
@ -193,7 +187,6 @@ class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -203,8 +196,7 @@ class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "use_sss", text="Subsurface Scattering") col.prop(rd, "use_sss", text="Subsurface Scattering")
col.prop(rd, "use_envmaps", text="Environment Map") col.prop(rd, "use_envmaps", text="Environment Map")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "use_raytracing", text="Ray Tracing") col.prop(rd, "use_raytracing", text="Ray Tracing")
col.prop(rd, "color_management") col.prop(rd, "color_management")
col.prop(rd, "alpha_mode", text="Alpha") col.prop(rd, "alpha_mode", text="Alpha")
@ -224,7 +216,6 @@ class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -239,8 +230,7 @@ class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel):
sub.prop(rd, "parts_x", text="X") sub.prop(rd, "parts_x", text="X")
sub.prop(rd, "parts_y", text="Y") sub.prop(rd, "parts_y", text="Y")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Memory:") col.label(text="Memory:")
sub = col.column() sub = col.column()
sub.enabled = not (rd.use_border or rd.full_sample) sub.enabled = not (rd.use_border or rd.full_sample)
@ -273,7 +263,6 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -281,8 +270,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "use_compositing") col.prop(rd, "use_compositing")
col.prop(rd, "use_sequencer") col.prop(rd, "use_sequencer")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "dither_intensity", text="Dither", slider=True) col.prop(rd, "dither_intensity", text="Dither", slider=True)
layout.separator() layout.separator()
@ -297,10 +285,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
sub.prop(rd, "fields_still", text="Still") sub.prop(rd, "fields_still", text="Still")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(rd, "edge") col.prop(rd, "edge")
sub = col.column() sub = col.column()
sub.active = rd.edge sub.active = rd.edge
@ -322,7 +307,6 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
rd = context.scene.render rd = context.scene.render
file_format = rd.file_format file_format = rd.file_format
wide_ui = context.region.width > narrowui
layout.prop(rd, "output_path", text="") layout.prop(rd, "output_path", text="")
@ -331,8 +315,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "file_format", text="") col.prop(rd, "file_format", text="")
col.row().prop(rd, "color_mode", text="Color", expand=True) col.row().prop(rd, "color_mode", text="Color", expand=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "use_file_extension") col.prop(rd, "use_file_extension")
col.prop(rd, "use_overwrite") col.prop(rd, "use_overwrite")
col.prop(rd, "use_placeholder") col.prop(rd, "use_placeholder")
@ -351,8 +334,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.label(text="Codec:") col.label(text="Codec:")
col.prop(rd, "exr_codec", text="") col.prop(rd, "exr_codec", text="")
if wide_ui: col = split.column()
col = split.column()
elif file_format == 'OPEN_EXR': elif file_format == 'OPEN_EXR':
split = layout.split() split = layout.split()
@ -361,14 +343,12 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col.label(text="Codec:") col.label(text="Codec:")
col.prop(rd, "exr_codec", text="") col.prop(rd, "exr_codec", text="")
if wide_ui: subsplit = split.split()
subsplit = split.split() col = subsplit.column()
col = subsplit.column()
col.prop(rd, "exr_half") col.prop(rd, "exr_half")
col.prop(rd, "exr_zbuf") col.prop(rd, "exr_zbuf")
if wide_ui: col = subsplit.column()
col = subsplit.column()
col.prop(rd, "exr_preview") col.prop(rd, "exr_preview")
elif file_format == 'JPEG2000': elif file_format == 'JPEG2000':
@ -377,8 +357,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col.label(text="Depth:") col.label(text="Depth:")
col.row().prop(rd, "jpeg2k_depth", expand=True) col.row().prop(rd, "jpeg2k_depth", expand=True)
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "jpeg2k_preset", text="") col.prop(rd, "jpeg2k_preset", text="")
col.prop(rd, "jpeg2k_ycc") col.prop(rd, "jpeg2k_ycc")
@ -387,8 +366,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(rd, "cineon_log", text="Convert to Log") col.prop(rd, "cineon_log", text="Convert to Log")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.active = rd.cineon_log col.active = rd.cineon_log
col.prop(rd, "cineon_black", text="Black") col.prop(rd, "cineon_black", text="Black")
col.prop(rd, "cineon_white", text="White") col.prop(rd, "cineon_white", text="White")
@ -415,21 +393,22 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
if rd.quicktime_audiocodec_type == 'LPCM': if rd.quicktime_audiocodec_type == 'LPCM':
col.prop(rd, "quicktime_audio_bitdepth", text="") col.prop(rd, "quicktime_audio_bitdepth", text="")
if wide_ui:
col = split.column() col = split.column()
col.prop(rd, "quicktime_audio_samplerate", text="") col.prop(rd, "quicktime_audio_samplerate", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
if rd.quicktime_audiocodec_type == 'AAC': if rd.quicktime_audiocodec_type == 'AAC':
col.prop(rd, "quicktime_audio_bitrate") col.prop(rd, "quicktime_audio_bitrate")
if wide_ui:
subsplit = split.split() subsplit = split.split()
col = subsplit.column() col = subsplit.column()
if rd.quicktime_audiocodec_type == 'AAC': if rd.quicktime_audiocodec_type == 'AAC':
col.prop(rd, "quicktime_audio_codec_isvbr") col.prop(rd, "quicktime_audio_codec_isvbr")
if wide_ui:
col = subsplit.column() col = subsplit.column()
col.prop(rd, "quicktime_audio_resampling_hq") col.prop(rd, "quicktime_audio_resampling_hq")
@ -447,7 +426,6 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") layout.menu("RENDER_MT_ffmpeg_presets", text="Presets")
@ -456,19 +434,17 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(rd, "ffmpeg_format") col.prop(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'): if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "ffmpeg_codec") col.prop(rd, "ffmpeg_codec")
else: else:
if wide_ui: split.label()
split.label()
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(rd, "ffmpeg_video_bitrate") col.prop(rd, "ffmpeg_video_bitrate")
if wide_ui:
col = split.column() col = split.column()
col.prop(rd, "ffmpeg_gopsize") col.prop(rd, "ffmpeg_gopsize")
split = layout.split() split = layout.split()
@ -479,8 +455,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "ffmpeg_maxrate", text="Maximum") col.prop(rd, "ffmpeg_maxrate", text="Maximum")
col.prop(rd, "ffmpeg_buffersize", text="Buffer") col.prop(rd, "ffmpeg_buffersize", text="Buffer")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "ffmpeg_autosplit") col.prop(rd, "ffmpeg_autosplit")
col.label(text="Mux:") col.label(text="Mux:")
@ -501,8 +476,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "ffmpeg_audio_bitrate") col.prop(rd, "ffmpeg_audio_bitrate")
col.prop(rd, "ffmpeg_audio_mixrate") col.prop(rd, "ffmpeg_audio_mixrate")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "ffmpeg_audio_volume", slider=True) col.prop(rd, "ffmpeg_audio_volume", slider=True)
@ -524,7 +498,6 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
layout.active = rd.render_antialiasing layout.active = rd.render_antialiasing
split = layout.split() split = layout.split()
@ -535,8 +508,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel):
sub.enabled = not rd.use_border sub.enabled = not rd.use_border
sub.prop(rd, "full_sample") sub.prop(rd, "full_sample")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "pixel_filter", text="") col.prop(rd, "pixel_filter", text="")
col.prop(rd, "filter_size", text="Size") col.prop(rd, "filter_size", text="Size")
@ -580,7 +552,6 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
scene = context.scene scene = context.scene
rd = scene.render rd = scene.render
wide_ui = context.region.width > narrowui
row = layout.row(align=True) row = layout.row(align=True)
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label) row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
@ -605,8 +576,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
sub.active = rd.use_border sub.active = rd.use_border
sub.prop(rd, "crop_to_border", text="Crop") sub.prop(rd, "crop_to_border", text="Crop")
if wide_ui: col = split.column()
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.label(text="Frame Range:") sub.label(text="Frame Range:")
sub.prop(scene, "frame_start", text="Start") sub.prop(scene, "frame_start", text="Start")
@ -637,7 +607,6 @@ class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
layout.active = rd.render_stamp layout.active = rd.render_stamp
@ -654,8 +623,7 @@ class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "stamp_marker", text="Marker") col.prop(rd, "stamp_marker", text="Marker")
col.prop(rd, "stamp_sequencer_strip", text="Seq. Strip") col.prop(rd, "stamp_sequencer_strip", text="Seq. Strip")
if wide_ui: col = split.column()
col = split.column()
col.active = rd.render_stamp col.active = rd.render_stamp
col.prop(rd, "stamp_foreground", slider=True) col.prop(rd, "stamp_foreground", slider=True)
col.prop(rd, "stamp_background", slider=True) col.prop(rd, "stamp_background", slider=True)
@ -683,20 +651,13 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui
layout.operator("object.bake_image", icon='RENDER_STILL') layout.operator("object.bake_image", icon='RENDER_STILL')
if wide_ui: layout.prop(rd, "bake_type")
layout.prop(rd, "bake_type")
else:
layout.prop(rd, "bake_type", text="")
if rd.bake_type == 'NORMALS': if rd.bake_type == 'NORMALS':
if wide_ui: layout.prop(rd, "bake_normal_space")
layout.prop(rd, "bake_normal_space")
else:
layout.prop(rd, "bake_normal_space", text="")
elif rd.bake_type in ('DISPLACEMENT', 'AO'): elif rd.bake_type in ('DISPLACEMENT', 'AO'):
layout.prop(rd, "bake_normalized") layout.prop(rd, "bake_normalized")
@ -712,8 +673,7 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel):
col.prop(rd, "bake_margin") col.prop(rd, "bake_margin")
col.prop(rd, "bake_quad_split", text="Split") col.prop(rd, "bake_quad_split", text="Split")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "bake_active") col.prop(rd, "bake_active")
sub = col.column() sub = col.column()
sub.active = rd.bake_active sub.active = rd.bake_active

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class SceneButtonsPanel(): class SceneButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -39,15 +37,10 @@ class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
scene = context.scene scene = context.scene
if wide_ui: layout.prop(scene, "camera")
layout.prop(scene, "camera") layout.prop(scene, "set", text="Background")
layout.prop(scene, "set", text="Background")
else:
layout.prop(scene, "camera", text="")
layout.prop(scene, "set", text="")
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel): class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -60,7 +53,6 @@ class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
unit = context.scene.unit_settings unit = context.scene.unit_settings
col = layout.column() col = layout.column()
@ -72,8 +64,7 @@ class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(unit, "scale_length", text="Scale") col.prop(unit, "scale_length", text="Scale")
if wide_ui: col = split.column()
col = split.column()
col.prop(unit, "use_separate") col.prop(unit, "use_separate")
layout.column().prop(unit, "rotation_units") layout.column().prop(unit, "rotation_units")
@ -86,7 +77,6 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
scene = context.scene scene = context.scene
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
col = row.column() col = row.column()
@ -108,8 +98,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel):
op = subcol.operator("anim.keying_set_export", text="Export to File") op = subcol.operator("anim.keying_set_export", text="Export to File")
op.filepath = "keyingset.py" op.filepath = "keyingset.py"
if wide_ui: col = row.column()
col = row.column()
col.label(text="Keyframing Settings:") col.label(text="Keyframing Settings:")
col.prop(ks, "insertkey_needed", text="Needed") col.prop(ks, "insertkey_needed", text="Needed")
col.prop(ks, "insertkey_visual", text="Visual") col.prop(ks, "insertkey_visual", text="Visual")
@ -128,7 +117,6 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel):
scene = context.scene scene = context.scene
ks = scene.active_keying_set ks = scene.active_keying_set
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.label(text="Paths:") row.label(text="Paths:")
@ -158,8 +146,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel):
if ksp.entire_array is False: if ksp.entire_array is False:
col.prop(ksp, "array_index") col.prop(ksp, "array_index")
if wide_ui: col = row.column()
col = row.column()
col.label(text="F-Curve Grouping:") col.label(text="F-Curve Grouping:")
col.prop(ksp, "grouping") col.prop(ksp, "grouping")
if ksp.grouping == 'NAMED': if ksp.grouping == 'NAMED':
@ -182,14 +169,10 @@ class SCENE_PT_physics(SceneButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
scene = context.scene scene = context.scene
wide_ui = context.region.width > narrowui
layout.active = scene.use_gravity layout.active = scene.use_gravity
if wide_ui: layout.prop(scene, "gravity", text="")
layout.prop(scene, "gravity", text="")
else:
layout.column().prop(scene, "gravity", text="")
class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel): class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
@ -205,7 +188,6 @@ class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
scene = context.scene scene = context.scene
rd = scene.render rd = scene.render
wide_ui = context.region.width > narrowui
layout.active = rd.use_simplify layout.active = rd.use_simplify
@ -217,8 +199,7 @@ class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel):
col.prop(rd, "simplify_triangulate") col.prop(rd, "simplify_triangulate")
if wide_ui: col = split.column()
col = split.column()
col.prop(rd, "simplify_shadow_samples", text="Shadow Samples") col.prop(rd, "simplify_shadow_samples", text="Shadow Samples")
col.prop(rd, "simplify_ao_sss", text="AO and SSS") col.prop(rd, "simplify_ao_sss", text="AO and SSS")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class TEXTURE_MT_specials(bpy.types.Menu): class TEXTURE_MT_specials(bpy.types.Menu):
bl_label = "Texture Specials" bl_label = "Texture Specials"
@ -112,7 +110,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
node = context.texture_node node = context.texture_node
space = context.space_data space = context.space_data
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
idblock = context_tex_datablock(context) idblock = context_tex_datablock(context)
tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush and not node tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush and not node
@ -126,11 +123,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN' col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="") col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="")
if wide_ui: split = layout.split(percentage=0.65)
split = layout.split(percentage=0.65) col = split.column()
col = split.column()
else:
col = layout.column()
if tex_collection: if tex_collection:
col.template_ID(idblock, "active_texture", new="texture.new") col.template_ID(idblock, "active_texture", new="texture.new")
@ -142,8 +136,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
if space.pin_id: if space.pin_id:
col.template_ID(space, "pin_id") col.template_ID(space, "pin_id")
if wide_ui: col = split.column()
col = split.column()
if not space.pin_id: if not space.pin_id:
col.prop(space, "brush_texture", text="Brush", toggle=True) col.prop(space, "brush_texture", text="Brush", toggle=True)
@ -158,11 +151,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
split.prop(slot, "output_node", text="") split.prop(slot, "output_node", text="")
else: else:
if wide_ui: split.label(text="Type:")
split.label(text="Type:") split.prop(tex, "type", text="")
split.prop(tex, "type", text="")
else:
layout.prop(tex, "type", text="")
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel): class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -189,7 +179,6 @@ class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
layout.prop(tex, "use_color_ramp", text="Ramp") layout.prop(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp: if tex.use_color_ramp:
@ -204,8 +193,7 @@ class TEXTURE_PT_colors(TextureButtonsPanel, bpy.types.Panel):
sub.prop(tex, "factor_green", text="G") sub.prop(tex, "factor_green", text="G")
sub.prop(tex, "factor_blue", text="B") sub.prop(tex, "factor_blue", text="B")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Adjust:") col.label(text="Adjust:")
col.prop(tex, "brightness") col.prop(tex, "brightness")
col.prop(tex, "contrast") col.prop(tex, "contrast")
@ -249,7 +237,6 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
tex = context.texture_slot tex = context.texture_slot
# textype = context.texture # textype = context.texture
wide_ui = context.region.width > narrowui
if type(idblock) != bpy.types.Brush: if type(idblock) != bpy.types.Brush:
split = layout.split(percentage=0.3) split = layout.split(percentage=0.3)
@ -301,11 +288,10 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
col.prop(tex, "from_dupli") col.prop(tex, "from_dupli")
elif tex.texture_coordinates == 'OBJECT': elif tex.texture_coordinates == 'OBJECT':
col.prop(tex, "from_original") col.prop(tex, "from_original")
elif wide_ui: else:
col.label() col.label()
if wide_ui: col = split.column()
col = split.column()
row = col.row() row = col.row()
row.prop(tex, "x_mapping", text="") row.prop(tex, "x_mapping", text="")
row.prop(tex, "y_mapping", text="") row.prop(tex, "y_mapping", text="")
@ -316,10 +302,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(tex, "offset") col.prop(tex, "offset")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(tex, "size") col.prop(tex, "size")
@ -348,7 +331,6 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
# textype = context.texture # textype = context.texture
tex = context.texture_slot tex = context.texture_slot
wide_ui = context.region.width > narrowui
def factor_but(layout, active, toggle, factor, name): def factor_but(layout, active, toggle, factor, name):
row = layout.row(align=True) row = layout.row(align=True)
@ -373,8 +355,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Shading:") col.label(text="Shading:")
factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
@ -399,9 +380,8 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering") factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection") factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
if wide_ui: col = split.column()
col = split.column() col.label(text=" ")
col.label(text=" ")
factor_but(col, tex.map_coloremission, "map_coloremission", "coloremission_factor", "Emission Color") factor_but(col, tex.map_coloremission, "map_coloremission", "coloremission_factor", "Emission Color")
factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color") factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color") factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
@ -412,8 +392,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
col = split.column() col = split.column()
factor_but(col, tex.map_color, "map_color", "color_factor", "Color") factor_but(col, tex.map_color, "map_color", "color_factor", "Color")
if wide_ui: col = split.column()
col = split.column()
factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow") factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif type(idblock) == bpy.types.World: elif type(idblock) == bpy.types.World:
@ -423,8 +402,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend") factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon") factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
if wide_ui: col = split.column()
col = split.column()
factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up") factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down") factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
@ -439,8 +417,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
sub.active = tex.rgb_to_intensity sub.active = tex.rgb_to_intensity
sub.prop(tex, "color", text="") sub.prop(tex, "color", text="")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "negate", text="Negative") col.prop(tex, "negate", text="Negative")
col.prop(tex, "stencil") col.prop(tex, "stencil")
@ -469,15 +446,11 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
layout.prop(tex, "stype", expand=True) layout.prop(tex, "stype", expand=True)
layout.label(text="Noise:") layout.label(text="Noise:")
layout.prop(tex, "noise_type", text="Type", expand=True) layout.prop(tex, "noise_type", text="Type", expand=True)
if wide_ui: layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
@ -485,8 +458,7 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
col.prop(tex, "noise_depth", text="Depth") col.prop(tex, "noise_depth", text="Depth")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "nabla", text="Nabla") col.prop(tex, "nabla", text="Nabla")
@ -505,22 +477,15 @@ class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
layout.prop(tex, "noisebasis2", expand=True) layout.prop(tex, "noisebasis2", expand=True)
if wide_ui: layout.prop(tex, "stype", expand=True)
layout.prop(tex, "stype", expand=True)
else:
layout.prop(tex, "stype", text="")
col = layout.column() col = layout.column()
col.active = tex.stype in ('RINGNOISE', 'BANDNOISE') col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col.label(text="Noise:") col.label(text="Noise:")
col.row().prop(tex, "noise_type", text="Type", expand=True) col.row().prop(tex, "noise_type", text="Type", expand=True)
if wide_ui: layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
split.active = tex.stype in ('RINGNOISE', 'BANDNOISE') split.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
@ -548,16 +513,12 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
layout.prop(tex, "stype", expand=True) layout.prop(tex, "stype", expand=True)
layout.prop(tex, "noisebasis2", expand=True) layout.prop(tex, "noisebasis2", expand=True)
layout.label(text="Noise:") layout.label(text="Noise:")
layout.prop(tex, "noise_type", text="Type", expand=True) layout.prop(tex, "noise_type", text="Type", expand=True)
if wide_ui: layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
@ -565,8 +526,7 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
col.prop(tex, "noise_depth", text="Depth") col.prop(tex, "noise_depth", text="Depth")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "turbulence") col.prop(tex, "turbulence")
col.prop(tex, "nabla") col.prop(tex, "nabla")
@ -586,15 +546,13 @@ class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(tex, "noise_depth", text="Depth") col.prop(tex, "noise_depth", text="Depth")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "turbulence") col.prop(tex, "turbulence")
@ -613,12 +571,8 @@ class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(tex, "progression")
layout.prop(tex, "progression")
else:
layout.prop(tex, "progression", text="")
sub = layout.row() sub = layout.row()
@ -641,23 +595,18 @@ class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
layout.prop(tex, "stype", expand=True) layout.prop(tex, "stype", expand=True)
layout.label(text="Noise:") layout.label(text="Noise:")
layout.prop(tex, "noise_type", text="Type", expand=True) layout.prop(tex, "noise_type", text="Type", expand=True)
if wide_ui: layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "turbulence") col.prop(tex, "turbulence")
@ -710,7 +659,6 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
tex = context.texture tex = context.texture
# slot = context.texture_slot # slot = context.texture_slot
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -722,10 +670,8 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel):
col.separator() col.separator()
col.prop(tex, "flip_axis", text="Flip X/Y Axis") col.prop(tex, "flip_axis", text="Flip X/Y Axis")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(tex, "normal_map") col.prop(tex, "normal_map")
row = col.row() row = col.row()
row.active = tex.normal_map row.active = tex.normal_map
@ -756,12 +702,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(tex, "extension")
layout.prop(tex, "extension")
else:
layout.prop(tex, "extension", text="")
split = layout.split() split = layout.split()
@ -771,8 +713,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "repeat_x", text="X") col.prop(tex, "repeat_x", text="X")
col.prop(tex, "repeat_y", text="Y") col.prop(tex, "repeat_y", text="Y")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Mirror:") col.label(text="Mirror:")
col.prop(tex, "mirror_x", text="X") col.prop(tex, "mirror_x", text="X")
col.prop(tex, "mirror_y", text="Y") col.prop(tex, "mirror_y", text="Y")
@ -784,8 +725,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
row.prop(tex, "checker_even", text="Even") row.prop(tex, "checker_even", text="Even")
row.prop(tex, "checker_odd", text="Odd") row.prop(tex, "checker_odd", text="Odd")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "checker_distance", text="Distance") col.prop(tex, "checker_distance", text="Distance")
layout.separator() layout.separator()
@ -798,8 +738,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "crop_min_x", text="X") col.prop(tex, "crop_min_x", text="X")
col.prop(tex, "crop_min_y", text="Y") col.prop(tex, "crop_min_y", text="Y")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Crop Maximum:") col.label(text="Crop Maximum:")
col.prop(tex, "crop_max_x", text="X") col.prop(tex, "crop_max_x", text="X")
col.prop(tex, "crop_max_y", text="Y") col.prop(tex, "crop_max_y", text="Y")
@ -841,7 +780,6 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
tex = context.texture tex = context.texture
env = tex.environment_map env = tex.environment_map
wide_ui = context.region.width > narrowui
row = layout.row() row = layout.row()
row.prop(env, "source", expand=True) row.prop(env, "source", expand=True)
@ -863,8 +801,7 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel):
col.prop(env, "resolution") col.prop(env, "resolution")
col.prop(env, "depth") col.prop(env, "depth")
if wide_ui: col = split.column(align=True)
col = split.column(align=True)
col.label(text="Clipping:") col.label(text="Clipping:")
col.prop(env, "clip_start", text="Start") col.prop(env, "clip_start", text="Start")
@ -906,12 +843,8 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(tex, "musgrave_type")
layout.prop(tex, "musgrave_type")
else:
layout.prop(tex, "musgrave_type", text="")
split = layout.split() split = layout.split()
@ -920,8 +853,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "lacunarity") col.prop(tex, "lacunarity")
col.prop(tex, "octaves") col.prop(tex, "octaves")
if wide_ui: col = split.column()
col = split.column()
if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')): if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.prop(tex, "offset") col.prop(tex, "offset")
if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')): if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
@ -930,18 +862,14 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel):
layout.label(text="Noise:") layout.label(text="Noise:")
if wide_ui: layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "nabla") col.prop(tex, "nabla")
@ -960,7 +888,6 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -974,8 +901,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "coloring", text="") col.prop(tex, "coloring", text="")
col.prop(tex, "noise_intensity", text="Intensity") col.prop(tex, "noise_intensity", text="Intensity")
if wide_ui: col = split.column()
col = split.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.label(text="Feature Weights:") sub.label(text="Feature Weights:")
sub.prop(tex, "weight_1", text="1", slider=True) sub.prop(tex, "weight_1", text="1", slider=True)
@ -990,8 +916,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "nabla") col.prop(tex, "nabla")
@ -1010,14 +935,9 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(tex, "noise_distortion")
layout.prop(tex, "noise_distortion") layout.prop(tex, "noise_basis", text="Basis")
layout.prop(tex, "noise_basis", text="Basis")
else:
layout.prop(tex, "noise_distortion", text="")
layout.prop(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
@ -1025,8 +945,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel):
col.prop(tex, "distortion", text="Distortion") col.prop(tex, "distortion", text="Distortion")
col.prop(tex, "noise_size", text="Size") col.prop(tex, "noise_size", text="Size")
if wide_ui: col = split.column()
col = split.column()
col.prop(tex, "nabla") col.prop(tex, "nabla")
@ -1084,12 +1003,8 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
tex = context.texture tex = context.texture
pd = tex.pointdensity pd = tex.pointdensity
wide_ui = context.region.width > narrowui
if wide_ui: layout.prop(pd, "point_source", expand=True)
layout.prop(pd, "point_source", expand=True)
else:
layout.prop(pd, "point_source", text="")
split = layout.split() split = layout.split()
@ -1120,8 +1035,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel):
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
layout.template_color_ramp(pd, "color_ramp", expand=True) layout.template_color_ramp(pd, "color_ramp", expand=True)
if wide_ui: col = split.column()
col = split.column()
col.label() col.label()
col.prop(pd, "radius") col.prop(pd, "radius")
col.label(text="Falloff:") col.label(text="Falloff:")
@ -1154,7 +1068,6 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
tex = context.texture tex = context.texture
pd = tex.pointdensity pd = tex.pointdensity
layout.active = pd.turbulence layout.active = pd.turbulence
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -1164,9 +1077,8 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel):
col.label(text="Noise Basis:") col.label(text="Noise Basis:")
col.prop(pd, "noise_basis", text="") col.prop(pd, "noise_basis", text="")
if wide_ui: col = split.column()
col = split.column() col.label()
col.label()
col.prop(pd, "turbulence_size") col.prop(pd, "turbulence_size")
col.prop(pd, "turbulence_depth") col.prop(pd, "turbulence_depth")
col.prop(pd, "turbulence_strength") col.prop(pd, "turbulence_strength")

@ -20,8 +20,6 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = bpy.context.user_preferences.view.properties_width_check
class WorldButtonsPanel(): class WorldButtonsPanel():
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -59,17 +57,12 @@ class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel):
scene = context.scene scene = context.scene
world = context.world world = context.world
space = context.space_data space = context.space_data
wide_ui = context.region.width > narrowui
split = layout.split(percentage=0.65)
if wide_ui: if scene:
split = layout.split(percentage=0.65) split.template_ID(scene, "world", new="world.new")
if scene: elif world:
split.template_ID(scene, "world", new="world.new") split.template_ID(space, "pin_id")
elif world:
split.template_ID(space, "pin_id")
else:
layout.template_ID(scene, "world", new="world.new")
class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel): class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel):
@ -83,19 +76,12 @@ class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
world = context.world world = context.world
if wide_ui: row = layout.row()
row = layout.row() row.prop(world, "paper_sky")
row.prop(world, "paper_sky") row.prop(world, "blend_sky")
row.prop(world, "blend_sky") row.prop(world, "real_sky")
row.prop(world, "real_sky")
else:
col = layout.column()
col.prop(world, "paper_sky")
col.prop(world, "blend_sky")
col.prop(world, "real_sky")
row = layout.row() row = layout.row()
row.column().prop(world, "horizon_color") row.column().prop(world, "horizon_color")
@ -117,7 +103,6 @@ class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
world = context.world world = context.world
layout.active = world.mist.use_mist layout.active = world.mist.use_mist
@ -128,8 +113,7 @@ class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel):
col.prop(world.mist, "intensity", slider=True) col.prop(world.mist, "intensity", slider=True)
col.prop(world.mist, "start") col.prop(world.mist, "start")
if wide_ui: col = split.column()
col = split.column()
col.prop(world.mist, "depth") col.prop(world.mist, "depth")
col.prop(world.mist, "height") col.prop(world.mist, "height")
@ -148,7 +132,6 @@ class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
world = context.world world = context.world
layout.active = world.stars.use_stars layout.active = world.stars.use_stars
@ -159,8 +142,7 @@ class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel):
col.prop(world.stars, "size") col.prop(world.stars, "size")
col.prop(world.stars, "color_randomization", text="Colors") col.prop(world.stars, "color_randomization", text="Colors")
if wide_ui: col = split.column()
col = split.column()
col.prop(world.stars, "min_distance", text="Min. Dist") col.prop(world.stars, "min_distance", text="Min. Dist")
col.prop(world.stars, "average_separation", text="Separation") col.prop(world.stars, "average_separation", text="Separation")

@ -19,8 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class IMAGE_MT_view(bpy.types.Menu): class IMAGE_MT_view(bpy.types.Menu):
bl_label = "View" bl_label = "View"
@ -366,7 +364,6 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
sima = context.space_data sima = context.space_data
ima = sima.image ima = sima.image
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -387,8 +384,7 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
sub.prop(ima, "tiles_x", text="X") sub.prop(ima, "tiles_x", text="X")
sub.prop(ima, "tiles_y", text="Y") sub.prop(ima, "tiles_y", text="Y")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Clamp:") col.label(text="Clamp:")
col.prop(ima, "clamp_x", text="X") col.prop(ima, "clamp_x", text="X")
col.prop(ima, "clamp_y", text="Y") col.prop(ima, "clamp_y", text="Y")
@ -509,7 +505,6 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
ima = sima.image ima = sima.image
show_uvedit = sima.show_uvedit show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor uvedit = sima.uv_editor
wide_ui = context.region.width > narrowui
split = layout.split() split = layout.split()
@ -517,8 +512,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
if ima: if ima:
col.prop(ima, "display_aspect", text="Aspect Ratio") col.prop(ima, "display_aspect", text="Aspect Ratio")
if wide_ui: col = split.column()
col = split.column()
col.label(text="Coordinates:") col.label(text="Coordinates:")
col.prop(sima, "draw_repeated", text="Repeat") col.prop(sima, "draw_repeated", text="Repeat")
if show_uvedit: if show_uvedit:
@ -536,10 +530,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
col = layout.column() col = layout.column()
col.label(text="UVs:") col.label(text="UVs:")
row = col.row() row = col.row()
if wide_ui: row.prop(uvedit, "edge_draw_type", expand=True)
row.prop(uvedit, "edge_draw_type", expand=True)
else:
row.prop(uvedit, "edge_draw_type", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -548,8 +539,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
#col.prop(uvedit, "draw_edges") #col.prop(uvedit, "draw_edges")
#col.prop(uvedit, "draw_faces") #col.prop(uvedit, "draw_faces")
if wide_ui: col = split.column()
col = split.column()
col.prop(uvedit, "draw_stretch", text="Stretch") col.prop(uvedit, "draw_stretch", text="Stretch")
sub = col.column() sub = col.column()
sub.active = uvedit.draw_stretch sub.active = uvedit.draw_stretch

@ -176,12 +176,6 @@ class USERPREF_PT_interface(bpy.types.Panel):
sub.prop(view, "mini_axis_brightness", text="Brightness") sub.prop(view, "mini_axis_brightness", text="Brightness")
col.separator() col.separator()
col.separator()
col.separator()
col.label(text="Properties Window:")
col.prop(view, "properties_width_check")
row.separator() row.separator()
row.separator() row.separator()

@ -19,7 +19,6 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class View3DPanel(): class View3DPanel():
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'
@ -742,7 +741,6 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
if context.sculpt_object: if context.sculpt_object:
#XXX duplicated from properties_texture.py #XXX duplicated from properties_texture.py
wide_ui = context.region.width > narrowui
col.separator() col.separator()
@ -787,10 +785,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(tex_slot, "offset") col.prop(tex_slot, "offset")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(tex_slot, "size") col.prop(tex_slot, "size")
@ -991,7 +986,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui
tool_settings = context.tool_settings tool_settings = context.tool_settings
sculpt = tool_settings.sculpt sculpt = tool_settings.sculpt
@ -1010,10 +1004,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size") col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength") col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.label(text="Lock:") col.label(text="Lock:")
row = col.row(align=True) row = col.row(align=True)
@ -1032,7 +1023,6 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, bpy.types.Panel):
return (context.sculpt_object and context.tool_settings.sculpt) return (context.sculpt_object and context.tool_settings.sculpt)
def draw(self, context): def draw(self, context):
wide_ui = context.region.width > narrowui
layout = self.layout layout = self.layout
@ -1049,10 +1039,7 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, bpy.types.Panel):
col.prop(sculpt, "symmetry_y", text="Y") col.prop(sculpt, "symmetry_y", text="Y")
col.prop(sculpt, "symmetry_z", text="Z") col.prop(sculpt, "symmetry_z", text="Z")
if wide_ui: col = split.column()
col = split.column()
else:
col.separator()
col.prop(sculpt, "radial_symm", text="Radial") col.prop(sculpt, "radial_symm", text="Radial")

@ -1511,11 +1511,6 @@ void init_userdef_do_versions(void)
if (U.v2d_min_gridsize == 0) { if (U.v2d_min_gridsize == 0) {
U.v2d_min_gridsize= 35; U.v2d_min_gridsize= 35;
} }
/* Single Column UI Value */
if (U.propwidth == 0) {
U.propwidth = 200;
}
/* funny name, but it is GE stuff, moves userdef stuff to engine */ /* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options(); // XXX space_set_commmandline_options();

@ -364,7 +364,7 @@ typedef struct UserDef {
short scrcastfps; /* frame rate for screencast to be played back */ short scrcastfps; /* frame rate for screencast to be played back */
short scrcastwait; /* milliseconds between screencast snapshots */ short scrcastwait; /* milliseconds between screencast snapshots */
short propwidth, pad[3]; /* Value for Dual/Single Column UI */ short pad8, pad[3]; /* Value for Dual/Single Column UI */
char versemaster[160]; char versemaster[160];
char verseuser[160]; char verseuser[160];

@ -2048,13 +2048,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL); RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames"); RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
RNA_def_property_update(prop, 0, "rna_userdef_update"); RNA_def_property_update(prop, 0, "rna_userdef_update");
/* Properties Window */
prop= RNA_def_property(srna, "properties_width_check", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "propwidth");
RNA_def_property_range(prop, 150, 400);
RNA_def_property_ui_text(prop, "Width Check", "Dual Column layout will change to single column layout when the width of the area gets below this value (needs restart to take effect)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
} }
static void rna_def_userdef_edit(BlenderRNA *brna) static void rna_def_userdef_edit(BlenderRNA *brna)