diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-06 19:17:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-06 19:17:44 +0400 |
commit | acca04bf33a5082cad0cee137d4a7a1fec81350d (patch) | |
tree | 76ff2bdeff5e20188e726040bd9a6d3526574d98 | |
parent | 17bd603cbcedc78c1adea816ebccfc90dc8837f7 (diff) |
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.
33 files changed, 659 insertions, 1523 deletions
diff --git a/release/scripts/ui/properties_animviz.py b/release/scripts/ui/properties_animviz.py index e15b7354cee..b337485ae10 100644 --- a/release/scripts/ui/properties_animviz.py +++ b/release/scripts/ui/properties_animviz.py @@ -19,9 +19,7 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check -################################################ # Generic Panels (Independent of DataType) @@ -31,15 +29,12 @@ class MotionPathButtonsPanel(): bl_label = "Motion Paths" 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 mps = avs.motion_paths - if wide_ui: - layout.prop(mps, "type", expand=True) - else: - layout.prop(mps, "type", text="") + layout.prop(mps, "type", expand=True) split = layout.split() @@ -56,8 +51,7 @@ class MotionPathButtonsPanel(): if bones: col.row().prop(mps, "bake_location", expand=True) - if wide_ui: - col = split.column() + col = split.column() col.label(text="Display:") col.prop(mps, "show_frame_numbers", text="Frame Numbers") col.prop(mps, "highlight_keyframes", text="Keyframes") @@ -77,12 +71,8 @@ class OnionSkinButtonsPanel(): layout = self.layout arm = context.armature - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(arm, "ghost_type", expand=True) - else: - layout.prop(arm, "ghost_type", text="") + layout.prop(arm, "ghost_type", expand=True) split = layout.split() @@ -97,8 +87,7 @@ class OnionSkinButtonsPanel(): sub.prop(arm, "ghost_step", text="Range") sub.prop(arm, "ghost_size", text="Step") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Display:") col.prop(arm, "ghost_only_selected", text="Selected Only") diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 3dc1b47b3ef..2f5ffd0803f 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -43,18 +41,14 @@ class DATA_PT_context_arm(DataButtonsPanel, bpy.types.Panel): ob = context.object arm = context.armature space = context.space_data - wide_ui = context.region.width > narrowui - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif arm: - split.template_ID(space, "pin_id") - split.separator() - else: - layout.template_ID(ob, "data") + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif arm: + split.template_ID(space, "pin_id") + split.separator() 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 arm = context.armature - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(arm, "pose_position", expand=True) - else: - layout.prop(arm, "pose_position", text="") + layout.prop(arm, "pose_position", expand=True) 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_envelope", text="Envelopes") - if wide_ui: - col = split.column() + col = split.column() col.prop(arm, "deform_quaternion", text="Quaternion") @@ -104,12 +93,8 @@ class DATA_PT_display(DataButtonsPanel, bpy.types.Panel): ob = context.object arm = context.armature - wide_ui = context.region.width > narrowui - if wide_ui: - layout.row().prop(arm, "drawtype", expand=True) - else: - layout.row().prop(arm, "drawtype", text="") + layout.row().prop(arm, "drawtype", expand=True) 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_custom_bone_shapes", text="Shapes") - if wide_ui: - col = split.column() + col = split.column() col.prop(arm, "draw_group_colors", text="Colors") col.prop(ob, "x_ray", text="X-Ray") col.prop(arm, "delay_deform", text="Delay Refresh") @@ -137,7 +121,6 @@ class DATA_PT_bone_groups(DataButtonsPanel, bpy.types.Panel): ob = context.object pose = ob.pose - wide_ui = context.region.width > narrowui row = layout.row() 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.prop(group, "color_set") if group.color_set: - if wide_ui: - col = split.column() + col = split.column() col.template_triColorSet(group, "colors") row = layout.row() @@ -183,12 +165,8 @@ class DATA_PT_ghost(DataButtonsPanel, bpy.types.Panel): layout = self.layout arm = context.armature - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(arm, "ghost_type", expand=True) - else: - layout.prop(arm, "ghost_type", text="") + layout.prop(arm, "ghost_type", expand=True) 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_size", text="Step") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Display:") 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 itasc = ob.pose.ik_param - wide_ui = (context.region.width > narrowui) row = layout.row() row.prop(ob.pose, "ik_solver") @@ -241,8 +217,7 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel, bpy.types.Panel): col = split.column() col.prop(itasc, "precision") - if wide_ui: - col = split.column() + col = split.column() col.prop(itasc, "num_iter") @@ -279,9 +254,8 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel): layout = self.layout 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() @@ -290,8 +264,7 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel): col = split.column() 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") @@ -308,9 +281,8 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # inhe layout = self.layout 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(): pass diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py index 91d5d06e5fe..d0a6821c16b 100644 --- a/release/scripts/ui/properties_data_armature_rigify.py +++ b/release/scripts/ui/properties_data_armature_rigify.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class PoseTemplateSettings(bpy.types.IDPropertyGroup): pass diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py index 39e27ed6e20..108845ae8fc 100644 --- a/release/scripts/ui/properties_data_bone.py +++ b/release/scripts/ui/properties_data_bone.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class BoneButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -68,65 +66,42 @@ class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel): ob = context.object bone = context.bone - wide_ui = context.region.width > narrowui if not bone: bone = context.edit_bone - if wide_ui: - row = layout.row() - row.column().prop(bone, "head") - row.column().prop(bone, "tail") - - col = row.column() - sub = col.column(align=True) - sub.label(text="Roll:") - sub.prop(bone, "roll", text="") - sub.label() - sub.prop(bone, "lock") - else: - col = layout.column() - col.prop(bone, "head") - col.prop(bone, "tail") - col.prop(bone, "roll") - col.prop(bone, "lock") + row = layout.row() + row.column().prop(bone, "head") + row.column().prop(bone, "tail") + + col = row.column() + sub = col.column(align=True) + sub.label(text="Roll:") + sub.prop(bone, "roll", text="") + sub.label() + sub.prop(bone, "lock") else: pchan = ob.pose.bones[context.bone.name] - if wide_ui: - row = layout.row() - col = row.column() - col.prop(pchan, "location") - col.active = not (bone.parent and bone.connected) - - col = row.column() - if pchan.rotation_mode == 'QUATERNION': - col.prop(pchan, "rotation_quaternion", text="Rotation") - elif pchan.rotation_mode == 'AXIS_ANGLE': - #col.label(text="Rotation") - #col.prop(pchan, "rotation_angle", text="Angle") - #col.prop(pchan, "rotation_axis", text="Axis") - 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") + row = layout.row() + col = row.column() + col.prop(pchan, "location") + col.active = not (bone.parent and bone.connected) + + col = row.column() + if pchan.rotation_mode == 'QUATERNION': + col.prop(pchan, "rotation_quaternion", text="Rotation") + elif pchan.rotation_mode == 'AXIS_ANGLE': + #col.label(text="Rotation") + #col.prop(pchan, "rotation_angle", text="Angle") + #col.prop(pchan, "rotation_axis", text="Axis") + col.prop(pchan, "rotation_axis_angle", text="Rotation") else: - col = layout.column() - sub = col.column() - sub.active = not (bone.parent and bone.connected) - sub.prop(pchan, "location") - col.label(text="Rotation:") - 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") + col.prop(pchan, "rotation_euler", text="Rotation") + + row.column().prop(pchan, "scale") + + layout.prop(pchan, "rotation_mode") class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel): @@ -170,7 +145,6 @@ class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel): ob = context.object bone = context.bone arm = context.armature - wide_ui = context.region.width > narrowui if not bone: bone = context.edit_bone @@ -190,8 +164,7 @@ class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel): col.label(text="Bone Group:") col.prop_object(pchan, "bone_group", ob.pose, "bone_groups", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Parent:") if context.bone: col.prop(bone, "parent", text="") @@ -220,7 +193,6 @@ class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel): ob = context.object bone = context.bone - wide_ui = context.region.width > narrowui if not 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, "hide", text="Hide") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Custom Shape:") col.prop(pchan, "custom_shape", text="") @@ -259,7 +230,6 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): ob = context.object bone = context.bone pchan = ob.pose.bones[bone.name] - wide_ui = context.region.width > narrowui row = layout.row() 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.active = pchan.ik_dof_x and pchan.has_ik - if wide_ui: - split = layout.split(percentage=0.25) - sub = split.row() - else: - sub = layout.column(align=True) + split = layout.split(percentage=0.25) + sub = split.row() + sub.prop(pchan, "ik_limit_x", text="Limit") 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_max_x", text="") 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.active = pchan.ik_dof_y and pchan.has_ik - if wide_ui: - split = layout.split(percentage=0.25) - sub = split.row() - else: - sub = layout.column(align=True) + split = layout.split(percentage=0.25) + sub = split.row() + sub.prop(pchan, "ik_limit_y", text="Limit") 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_max_y", text="") 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.active = pchan.ik_dof_z and pchan.has_ik - if wide_ui: - split = layout.split(percentage=0.25) - sub = split.row() - else: - sub = layout.column(align=True) + split = layout.split(percentage=0.25) + sub = split.row() + sub.prop(pchan, "ik_limit_z", text="Limit") 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_max_z", text="") sub.active = pchan.ik_dof_z and pchan.ik_limit_z and pchan.has_ik split = layout.split() split.prop(pchan, "ik_stretch", text="Stretch", slider=True) - if wide_ui: - split.label() + split.label() split.active = pchan.has_ik if ob.pose.ik_solver == 'ITASC': @@ -334,8 +295,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel): col = split.column() col.prop(pchan, "ik_rot_control", text="Control Rotation") 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.active = pchan.has_ik # not supported yet @@ -360,7 +320,6 @@ class BONE_PT_deform(BoneButtonsPanel, bpy.types.Panel): layout = self.layout bone = context.bone - wide_ui = context.region.width > narrowui if not 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, "tail_radius", text="Tail") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Curved Bones:") sub = col.column(align=True) diff --git a/release/scripts/ui/properties_data_camera.py b/release/scripts/ui/properties_data_camera.py index 15d513b5a25..75bf2eb86d2 100644 --- a/release/scripts/ui/properties_data_camera.py +++ b/release/scripts/ui/properties_data_camera.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -45,21 +43,14 @@ class DATA_PT_context_camera(DataButtonsPanel, bpy.types.Panel): ob = context.object cam = context.camera space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif cam: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif cam: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif cam: + split.template_ID(space, "pin_id") + split.separator() 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 cam = context.camera - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(cam, "type", expand=True) - else: - layout.prop(cam, "type", text="") + layout.prop(cam, "type", expand=True) split = layout.split() @@ -100,8 +87,7 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel): col.prop(cam, "lens", text="Angle") elif cam.lens_unit == 'DEGREES': col.prop(cam, "angle") - if wide_ui: - col = split.column() + col = split.column() col.prop(cam, "lens_unit", text="") 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_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Clipping:") col.prop(cam, "clip_start", text="Start") col.prop(cam, "clip_end", text="End") @@ -129,10 +114,8 @@ class DATA_PT_camera(DataButtonsPanel, bpy.types.Panel): col = split.column() col.prop(cam, "dof_object", text="") - if wide_ui: - col = split.column() - else: - col = col.column() + col = split.column() + if cam.dof_object != None: col.enabled = False col.prop(cam, "dof_distance", text="Distance") @@ -151,7 +134,6 @@ class DATA_PT_camera_display(DataButtonsPanel, bpy.types.Panel): layout = self.layout cam = context.camera - wide_ui = context.region.width > narrowui 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_name", text="Name") - if wide_ui: - col = split.column() + col = split.column() col.prop(cam, "draw_size", text="Size") col.separator() col.prop(cam, "show_passepartout", text="Passepartout") diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py index f07e29edbb2..43f2f3497bb 100644 --- a/release/scripts/ui/properties_data_curve.py +++ b/release/scripts/ui/properties_data_curve.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -60,20 +58,15 @@ class DATA_PT_context_curve(DataButtonsPanel, bpy.types.Panel): ob = context.object curve = context.curve 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: - split.template_ID(ob, "data") - split.separator() - elif curve: - split.template_ID(space, "pin_id") - split.separator() - else: - layout.template_ID(ob, "data") + if ob: + split.template_ID(ob, "data") + split.separator() + elif curve: + split.template_ID(space, "pin_id") + split.separator() 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 curve = context.curve - wide_ui = context.region.width > narrowui is_surf = (ob.type == 'SURFACE') is_curve = (ob.type == 'CURVE') is_text = (ob.type == 'TEXT') @@ -112,8 +104,7 @@ class DATA_PT_shape_curve(DataButtonsPanel, bpy.types.Panel): col.label(text="Display:") col.prop(curve, "fast", text="Fast Editing") - if wide_ui: - col = split.column() + col = split.column() if is_surf: sub = col.column(align=True) @@ -148,7 +139,6 @@ class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel): layout = self.layout curve = context.curve - wide_ui = context.region.width > narrowui split = layout.split() @@ -159,8 +149,7 @@ class DATA_PT_geometry_curve(DataButtonsPanel, bpy.types.Panel): col.label(text="Taper Object:") col.prop(curve, "taper_object", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Bevel:") col.prop(curve, "bevel_depth", text="Depth") col.prop(curve, "bevel_resolution", text="Resolution") @@ -180,7 +169,6 @@ class DATA_PT_pathanim(DataButtonsPanelCurve, bpy.types.Panel): layout = self.layout curve = context.curve - wide_ui = context.region.width > narrowui 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_deform_bounds") - if wide_ui: - col = split.column() + col = split.column() col.prop(curve, "use_radius") col.prop(curve, "use_time_offset", text="Offset Children") @@ -284,21 +271,16 @@ class DATA_PT_font(DataButtonsPanel, bpy.types.Panel): text = context.curve char = context.curve.edit_format - wide_ui = context.region.width > narrowui layout.template_ID(text, "font", open="font.open", unlink="font.unlink") - #if wide_ui: - # layout.prop(text, "font") - #else: - # layout.prop(text, "font", text="") + #layout.prop(text, "font") split = layout.split() col = split.column() col.prop(text, "text_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(text, "shear") split = layout.split() @@ -307,8 +289,7 @@ class DATA_PT_font(DataButtonsPanel, bpy.types.Panel): col.label(text="Object Font:") col.prop(text, "family", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Text on Curve:") 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_height", text="Thickness") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Character:") col.prop(char, "bold") col.prop(char, "italic") @@ -346,13 +326,9 @@ class DATA_PT_paragraph(DataButtonsPanel, bpy.types.Panel): layout = self.layout text = context.curve - wide_ui = context.region.width > narrowui layout.label(text="Align:") - if wide_ui: - layout.prop(text, "spacemode", expand=True) - else: - layout.prop(text, "spacemode", text="") + layout.prop(text, "spacemode", expand=True) 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, "line_dist", text="Line") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Offset:") col.prop(text, "offset_x", text="X") col.prop(text, "offset_y", text="Y") @@ -380,13 +355,11 @@ class DATA_PT_textboxes(DataButtonsPanel, bpy.types.Panel): layout = self.layout text = context.curve - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.operator("font.textbox_add", icon='ZOOMIN') - if wide_ui: - col = split.column() + col = split.column() 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, "height", text="Height") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Offset:") col.prop(box, "x", text="X") diff --git a/release/scripts/ui/properties_data_empty.py b/release/scripts/ui/properties_data_empty.py index 31fb4b4a625..b4725647a0a 100644 --- a/release/scripts/ui/properties_data_empty.py +++ b/release/scripts/ui/properties_data_empty.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -39,12 +37,8 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(ob, "empty_draw_type", text="Display") - else: - layout.prop(ob, "empty_draw_type", text="") + layout.prop(ob, "empty_draw_type", text="Display") layout.prop(ob, "empty_draw_size", text="Size") diff --git a/release/scripts/ui/properties_data_lamp.py b/release/scripts/ui/properties_data_lamp.py index 69b22c555ab..709429c0ecc 100644 --- a/release/scripts/ui/properties_data_lamp.py +++ b/release/scripts/ui/properties_data_lamp.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class LAMP_MT_sunsky_presets(bpy.types.Menu): bl_label = "Sun & Sky Presets" @@ -65,21 +63,14 @@ class DATA_PT_context_lamp(DataButtonsPanel, bpy.types.Panel): ob = context.object lamp = context.lamp space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif lamp: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif lamp: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif lamp: + split.template_ID(space, "pin_id") + split.separator() 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 lamp = context.lamp - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(lamp, "type", expand=True) - else: - layout.prop(lamp, "type", text="") + layout.prop(lamp, "type", expand=True) split = layout.split() @@ -136,8 +123,7 @@ class DATA_PT_lamp(DataButtonsPanel, bpy.types.Panel): col.prop(lamp, "distance") col.prop(lamp, "gamma") - if wide_ui: - col = split.column() + col = split.column() col.prop(lamp, "negative") col.prop(lamp, "layer", text="This Layer Only") col.prop(lamp, "specular") @@ -158,7 +144,6 @@ class DATA_PT_sunsky(DataButtonsPanel, bpy.types.Panel): layout = self.layout lamp = context.lamp.sky - wide_ui = context.region.width > narrowui row = layout.row(align=True) 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.prop(lamp, "sky_exposure", text="Exposure") - if wide_ui: - col = split.column() + col = split.column() col.active = lamp.use_sky col.label(text="Horizon:") 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, "atmosphere_distance_factor", text="Distance") - if wide_ui: - col = split.column() + col = split.column() col.active = lamp.use_atmosphere col.label(text="Scattering:") sub = col.column(align=True) @@ -232,29 +215,8 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel): layout = self.layout lamp = context.lamp - wide_ui = context.region.width > narrowui - - if wide_ui: - 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") + layout.prop(lamp, "shadow_method", expand=True) if lamp.shadow_method != 'NOSHADOW': split = layout.split() @@ -262,65 +224,55 @@ class DATA_PT_shadow(DataButtonsPanel, bpy.types.Panel): col = split.column() 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, "only_shadow") if lamp.shadow_method == 'RAY_SHADOW': - split = layout.split() - - col = split.column() + col = layout.column() col.label(text="Sampling:") - + col.row().prop(lamp, "shadow_ray_sampling_method", expand=True) + if lamp.type in ('POINT', 'SUN', 'SPOT'): - if wide_ui: - sub=col.row() - else: - sub=col.column() - - sub.prop(lamp, "shadow_ray_samples", text="Samples") - sub.prop(lamp, "shadow_soft_size", text="Soft Size") - + split = layout.split() + + col = split.column() + col.prop(lamp, "shadow_soft_size", text="Soft Size") + + col.prop(lamp, "shadow_ray_samples", text="Samples") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + col.prop(lamp, "shadow_adaptive_threshold", text="Threshold") + + col = split.column() + elif lamp.type == 'AREA': - if wide_ui: - sub=col.row(align=True) - else: - sub=col.column(align=True) - + split = layout.split() + + col = split.column() + 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': - sub.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_x", text="Samples X") + col.prop(lamp, "shadow_ray_samples_y", text="Samples Y") - if wide_ui: - col.row().prop(lamp, "shadow_ray_sampling_method", expand=True) - else: - col.prop(lamp, "shadow_ray_sampling_method", text="") + if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC': + col.prop(lamp, "shadow_adaptive_threshold", text="Threshold") + col = split.column() - 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: + elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': + col = split.column() + col.prop(lamp, "umbra") + col.prop(lamp, "dither") + col.prop(lamp, "jitter") + else: col = split.column() - - if lamp.type == 'AREA' and lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': - col = split.column() - col = split.column() - col.prop(lamp, "umbra") - col.prop(lamp, "dither") - col.prop(lamp, "jitter") + elif lamp.shadow_method == 'BUFFER_SHADOW': col = layout.column() col.label(text="Buffer Type:") - if wide_ui: - col.row().prop(lamp, "shadow_buffer_type", expand=True) - else: - col.row().prop(lamp, "shadow_buffer_type", text="") + col.row().prop(lamp, "shadow_buffer_type", expand=True) if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'): 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_bias", text="Bias") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Sample Buffers:") col.prop(lamp, "shadow_sample_buffers", text="") 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.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") sub = col.column() 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) def draw(self, context): + layout = self.layout + lamp = context.lamp - wide_ui = context.region.width > narrowui - layout = self.layout split = layout.split() col = split.column() - - 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) + col.row().prop(lamp, "shape", expand=True) + sub = col.column(align=True) if (lamp.shape == 'SQUARE'): sub.prop(lamp, "size") elif (lamp.shape == 'RECTANGLE'): @@ -408,7 +353,6 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel): layout = self.layout lamp = context.lamp - wide_ui = context.region.width > narrowui split = layout.split() @@ -419,10 +363,8 @@ class DATA_PT_spot(DataButtonsPanel, bpy.types.Panel): col.prop(lamp, "square") col.prop(lamp, "show_cone") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() + col.prop(lamp, "halo") sub = col.column(align=True) sub.active = lamp.halo diff --git a/release/scripts/ui/properties_data_lattice.py b/release/scripts/ui/properties_data_lattice.py index 972dc18977a..a2dfeb191b8 100644 --- a/release/scripts/ui/properties_data_lattice.py +++ b/release/scripts/ui/properties_data_lattice.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -43,21 +41,14 @@ class DATA_PT_context_lattice(DataButtonsPanel, bpy.types.Panel): ob = context.object lat = context.lattice space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif lat: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif lat: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif lat: + split.template_ID(space, "pin_id") + split.separator() 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 lat = context.lattice - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(lat, "points_u") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_u", text="") split = layout.split() col = split.column() col.prop(lat, "points_v") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_v", text="") split = layout.split() col = split.column() col.prop(lat, "points_w") - if wide_ui: - col = split.column() + col = split.column() col.prop(lat, "interpolation_type_w", text="") row = layout.row() diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index e5a0f773df4..a2f9a313f2c 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class MESH_MT_vertex_group_specials(bpy.types.Menu): bl_label = "Vertex Group Specials" @@ -71,21 +69,14 @@ class DATA_PT_context_mesh(DataButtonsPanel, bpy.types.Panel): ob = context.object mesh = context.mesh space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif mesh: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif mesh: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif mesh: + split.template_ID(space, "pin_id") + split.separator() 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 mesh = context.mesh - wide_ui = context.region.width > narrowui split = layout.split() @@ -121,10 +111,8 @@ class DATA_PT_normals(DataButtonsPanel, bpy.types.Panel): sub.active = mesh.autosmooth sub.prop(mesh, "autosmooth_angle", text="Angle") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() + col.prop(mesh, "double_sided") @@ -210,7 +198,6 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel): ob = context.object key = ob.data.shape_keys kb = ob.active_shape_key - wide_ui = context.region.width > narrowui enable_edit = ob.mode != 'EDIT' enable_edit_value = False @@ -243,17 +230,11 @@ class DATA_PT_shape_keys(DataButtonsPanel, bpy.types.Panel): split = layout.split(percentage=0.4) row = split.row() row.enabled = enable_edit - if wide_ui: - row.prop(key, "relative") + row.prop(key, "relative") row = split.row() row.alignment = 'RIGHT' - if not wide_ui: - layout.prop(key, "relative") - row = layout.row() - - sub = row.row(align=True) subsub = sub.row(align=True) 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_max", text="Max") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.active = enable_edit_value col.label(text="Blend:") col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="") @@ -337,7 +317,6 @@ class DATA_PT_texface(DataButtonsPanel): layout = self.layout col = layout.column() - wide_ui = context.region.width > narrowui me = context.mesh tf = me.faces.active_tface @@ -355,8 +334,7 @@ class DATA_PT_texface(DataButtonsPanel): col.prop(tf, "twoside") col.prop(tf, "object_color") - if wide_ui: - col = split.column() + col = split.column() col.prop(tf, "halo") col.prop(tf, "billboard") diff --git a/release/scripts/ui/properties_data_metaball.py b/release/scripts/ui/properties_data_metaball.py index 215ca207bc9..dbc0f642c7c 100644 --- a/release/scripts/ui/properties_data_metaball.py +++ b/release/scripts/ui/properties_data_metaball.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -43,21 +41,14 @@ class DATA_PT_context_metaball(DataButtonsPanel, bpy.types.Panel): ob = context.object mball = context.meta_ball space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if ob: - split.template_ID(ob, "data") - split.separator() - elif mball: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "data") - elif mball: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if ob: + split.template_ID(ob, "data") + split.separator() + elif mball: + split.template_ID(space, "pin_id") + split.separator() 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 mball = context.meta_ball - wide_ui = context.region.width > narrowui 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, "render_size", text="Render") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Settings:") col.prop(mball, "threshold", text="Threshold") layout.label(text="Update:") - if wide_ui: - layout.prop(mball, "flag", expand=True) - else: - layout.prop(mball, "flag", text="") + layout.prop(mball, "flag", expand=True) 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 metaelem = context.meta_ball.active_element - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(metaelem, "type") - else: - layout.prop(metaelem, "type", text="") + layout.prop(metaelem, "type") 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, "hide", text="Hide") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) if metaelem.type in ('CUBE', 'ELLIPSOID'): col.label(text="Size:") diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py index ea0fb606aa4..ad16dce5030 100644 --- a/release/scripts/ui/properties_data_modifier.py +++ b/release/scripts/ui/properties_data_modifier.py @@ -19,9 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check -narrowmod = 260 - class DataButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -36,30 +33,27 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui - compact_mod = context.region.width < narrowmod layout.operator_menu_enum("object.modifier_add", "type") for md in ob.modifiers: - box = layout.template_modifier(md, compact=compact_mod) + box = layout.template_modifier(md) if box: # 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 # ...to avoid lengthy if statements # 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() col = split.column() col.label(text="Object:") col.prop(md, "object", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group::") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") 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_bone_envelopes", text="Bone Envelopes") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Deformation:") col.prop(md, "quaternion") col.prop(md, "multi_modifier") - def ARRAY(self, layout, ob, md, wide_ui): - if wide_ui: - layout.prop(md, "fit_type") - else: - layout.prop(md, "fit_type", text="") - + def ARRAY(self, layout, ob, md): + layout.prop(md, "fit_type") if md.fit_type == 'FIXED_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_distance", text="Distance") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "relative_offset") sub = col.column() 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, "end_cap") - def BEVEL(self, layout, ob, md, wide_ui): + def BEVEL(self, layout, ob, md): split = layout.split() col = split.column() col.prop(md, "width") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "only_vertices") layout.label(text="Limit Method:") @@ -148,40 +135,35 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): elif md.limit_method == 'WEIGHT': 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() col = split.column() col.label(text="Operation:") col.prop(md, "operation", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Object:") col.prop(md, "object", text="") - def BUILD(self, layout, ob, md, wide_ui): + def BUILD(self, layout, ob, md): split = layout.split() col = split.column() col.prop(md, "frame_start") col.prop(md, "length") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "randomize") sub = col.column() sub.active = md.randomize sub.prop(md, "seed") - def CAST(self, layout, ob, md, wide_ui): + def CAST(self, layout, ob, md): split = layout.split(percentage=0.25) - if wide_ui: - split.label(text="Cast Type:") - split.prop(md, "cast_type", text="") - else: - layout.prop(md, "cast_type", text="") + split.label(text="Cast Type:") + split.prop(md, "cast_type", text="") split = layout.split(percentage=0.25) @@ -201,37 +183,35 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col = split.column() col.label(text="Vertex Group:") 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.prop(md, "object", text="") if md.object: 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.") - def COLLISION(self, layout, ob, md, wide_ui): + def COLLISION(self, layout, ob, md): layout.label(text="See Collision panel.") - def CURVE(self, layout, ob, md, wide_ui): + def CURVE(self, layout, ob, md): split = layout.split() col = split.column() col.label(text="Object:") col.prop(md, "object", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group:") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") layout.label(text="Deformation Axis:") 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.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() col = split.column() @@ -240,8 +220,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.label(text="Vertex Group:") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Direction:") col.prop(md, "direction", text="") col.label(text="Texture Coordinates:") @@ -258,11 +237,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col = split.column() col.prop(md, "midlevel") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "strength") - def EDGE_SPLIT(self, layout, ob, md, wide_ui): + def EDGE_SPLIT(self, layout, ob, md): split = layout.split() col = split.column() @@ -271,11 +249,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): sub.active = md.use_edge_angle sub.prop(md, "split_angle") - if wide_ui: - col = split.column() + col = split.column() 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() col = split.column() @@ -285,8 +262,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): sub.active = bool(md.vertex_group) sub.prop(md, "protect") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "split_edges") col.prop(md, "unborn") col.prop(md, "alive") @@ -295,10 +271,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): 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.") - def HOOK(self, layout, ob, md, wide_ui): + def HOOK(self, layout, ob, md): split = layout.split() col = split.column() @@ -307,8 +283,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): if md.object and md.object.type == 'ARMATURE': col.label(text="Bone:") 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.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.prop(md, "falloff") col.prop(md, "force", slider=True) - if wide_ui: - col = split.column() - else: - col.separator() + + col = split.column() col.operator("object.hook_reset", text="Reset") 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_assign", text="Assign") - def LATTICE(self, layout, ob, md, wide_ui): + def LATTICE(self, layout, ob, md): split = layout.split() col = split.column() col.label(text="Object:") col.prop(md, "object", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group:") 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() col = split.column() col.label(text="Mode:") col.prop(md, "mode", text="") - if wide_ui: - col = split.column() + col = split.column() if md.mode == 'ARMATURE': col.label(text="Armature:") col.prop(md, "armature", text="") @@ -363,15 +334,14 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): sub.active = bool(md.vertex_group) sub.prop(md, "invert") - def MESH_DEFORM(self, layout, ob, md, wide_ui): + def MESH_DEFORM(self, layout, ob, md): split = layout.split() col = split.column() sub = col.column() sub.label(text="Object:") sub.prop(md, "object", text="") sub.active = not md.is_bound - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group:") 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.prop(md, "precision") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "dynamic") - def MIRROR(self, layout, ob, md, wide_ui): + def MIRROR(self, layout, ob, md): layout.prop(md, "merge_limit") - if wide_ui: - split = layout.split(percentage=0.25) - else: - split = layout.split(percentage=0.4) + split = layout.split(percentage=0.25) col = split.column() col.label(text="Axis:") @@ -408,11 +374,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.prop(md, "y") col.prop(md, "z") - if wide_ui: - col = split.column() - else: - subsplit = layout.split() - col = subsplit.column() + col = split.column() col.label(text="Options:") col.prop(md, "clip", text="Clipping") 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.prop(md, "mirror_object", text="") - def MULTIRES(self, layout, ob, md, wide_ui): - if wide_ui: - layout.row().prop(md, "subdivision_type", expand=True) - else: - layout.row().prop(md, "subdivision_type", text="") + def MULTIRES(self, layout, ob, md): + layout.row().prop(md, "subdivision_type", expand=True) split = layout.split() 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, "render_levels", text="Render") - if wide_ui: - col = split.column() + col = split.column() col.enabled = ob.mode != 'EDIT' 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.label() - def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui): + def PARTICLE_INSTANCE(self, layout, ob, md): layout.prop(md, "object") 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, "size") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Show Particles When:") col.prop(md, "alive") col.prop(md, "unborn") @@ -488,15 +445,14 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.row().prop(md, "axis", expand=True) col.prop(md, "keep_shape") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "position", 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.") - def SCREW(self, layout, ob, md, wide_ui): + def SCREW(self, layout, ob, md): split = layout.split() col = split.column() @@ -506,8 +462,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.prop(md, "steps") col.prop(md, "render_steps") - if wide_ui: - col = split.column() + col = split.column() row = col.row() row.active = (md.object is None or md.use_object_screw_offset == False) 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, "iterations") - def SHRINKWRAP(self, layout, ob, md, wide_ui): + def SHRINKWRAP(self, layout, ob, md): split = layout.split() col = split.column() col.label(text="Target:") col.prop(md, "target", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group:") 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, "subsurf_levels") - if wide_ui: - col = split.column() - col.label(text="Mode:") + col = split.column() + col.label(text="Mode:") col.prop(md, "mode", text="") - if wide_ui: - split = layout.split(percentage=0.25) - else: - split = layout.split(percentage=0.35) + split = layout.split(percentage=0.25) + col = split.column() if md.mode == 'PROJECT': @@ -556,11 +507,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.prop(md, "negative") col.prop(md, "positive") - if wide_ui: - col = split.column() - else: - subsplit = layout.split() - col = subsplit.column() + col = split.column() + col.label(text="Cull Faces:") col.prop(md, "cull_front_faces", text="Front") 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': 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() col = split.column() col.label(text="Mode:") col.prop(md, "mode", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Vertex Group:") 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.prop(md, "relative") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Deform:") col.prop(md, "factor") 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_y_axis") - def SMOKE(self, layout, ob, md, wide_ui): + def SMOKE(self, layout, ob, md): 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) col = split.column() @@ -619,10 +565,10 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.label(text="Vertex Group:") 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.") - def SOLIDIFY(self, layout, ob, md, wide_ui): + def SOLIDIFY(self, layout, ob, md): 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_rim", text="Rim") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "offset") colsub = col.column() @@ -655,11 +600,8 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): # col.label(text="Vertex Group:") # col.prop_object(md, "vertex_group", ob, "vertex_groups", text="") - def SUBSURF(self, layout, ob, md, wide_ui): - if wide_ui: - layout.row().prop(md, "subdivision_type", expand=True) - else: - layout.row().prop(md, "subdivision_type", text="") + def SUBSURF(self, layout, ob, md): + layout.row().prop(md, "subdivision_type", expand=True) split = layout.split() col = split.column() @@ -667,16 +609,15 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.prop(md, "levels", text="View") col.prop(md, "render_levels", text="Render") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Options:") col.prop(md, "subsurf_uv") 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.") - def UV_PROJECT(self, layout, ob, md, wide_ui): + def UV_PROJECT(self, layout, ob, md): if ob.type == 'MESH': split = layout.split() @@ -684,8 +625,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.label(text="Image:") col.prop(md, "image", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="UV Layer:") 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: col.prop(proj, "object", text="") - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.prop(md, "aspect_x", text="Aspect X") 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_y", text="Scale Y") - def WAVE(self, layout, ob, md, wide_ui): + def WAVE(self, layout, ob, md): split = layout.split() col = split.column() @@ -715,8 +654,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): col.prop(md, "y") col.prop(md, "cyclic") - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "normals") sub = col.column() sub.active = md.normals @@ -733,8 +671,7 @@ class DATA_PT_modifiers(DataButtonsPanel, bpy.types.Panel): sub.prop(md, "lifetime", text="Life") col.prop(md, "damping_time", text="Damping") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Position:") sub = col.column(align=True) 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, "height", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.prop(md, "width", slider=True) col.prop(md, "narrowness", slider=True) diff --git a/release/scripts/ui/properties_game.py b/release/scripts/ui/properties_game.py index ff618965d59..6d3225553ba 100644 --- a/release/scripts/ui/properties_game.py +++ b/release/scripts/ui/properties_game.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class PhysicsButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -44,12 +42,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel): ob = context.active_object game = ob.game soft = ob.game.soft_body - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(game, "physics_type") - else: - layout.prop(game, "physics_type", text="") + layout.prop(game, "physics_type") layout.separator() #if game.physics_type == 'DYNAMIC': @@ -61,8 +55,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel): col.prop(game, "ghost") 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, "rotate_from_normal") 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, "form_factor") - if wide_ui: - col = split.column() + col = split.column() sub = col.column() sub.active = (game.physics_type == 'RIGID_BODY') 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, "maximum_velocity", text="Maximum") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Damping:") sub = col.column(align=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, "bending_const", text="Bending Constraints") - if wide_ui: - col = split.column() + col = split.column() col.prop(soft, "shape_match") sub = col.column() sub.active = soft.shape_match @@ -182,21 +172,16 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel): layout = self.layout game = context.active_object.game - wide_ui = context.region.width > narrowui layout.active = game.use_collision_bounds - if wide_ui: - layout.prop(game, "collision_bounds", text="Bounds") - else: - layout.prop(game, "collision_bounds", text="") + layout.prop(game, "collision_bounds", text="Bounds") split = layout.split() col = split.column() 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") @@ -236,7 +221,6 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel): layout = self.layout gs = context.scene.game_data - wide_ui = context.region.width > narrowui 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_y", slider=False, text="Y") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Quality:") sub = col.column(align=True) sub.prop(gs, "depth", text="Bit Depth", slider=False) @@ -258,10 +241,7 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel): # framing: col = layout.column() col.label(text="Framing:") - if wide_ui: - col.row().prop(gs, "framing_type", expand=True) - else: - col.prop(gs, "framing_type", text="") + col.row().prop(gs, "framing_type", expand=True) if gs.framing_type == 'LETTERBOX': col.prop(gs, "framing_color", text="") @@ -280,7 +260,6 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel): gs = context.scene.game_data stereo_mode = gs.stereo - wide_ui = context.region.width > narrowui # stereo options: layout.prop(gs, "stereo", expand=True) @@ -292,10 +271,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel): # dome: elif stereo_mode == 'DOME': - if wide_ui: - layout.prop(gs, "dome_mode", text="Dome Type") - else: - layout.prop(gs, "dome_mode", text="") + layout.prop(gs, "dome_mode", text="Dome Type") 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_angle", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.prop(gs, "dome_tesselation", text="Tesselation") col.prop(gs, "dome_tilt") @@ -318,15 +293,14 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel): col = split.column() 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") else: # cube map col = split.column() col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) - if wide_ui: - col = split.column() + + col = split.column() layout.prop(gs, "dome_text") @@ -344,12 +318,8 @@ class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel): layout = self.layout gs = context.scene.game_data - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(gs, "material_mode", expand=True) - else: - layout.prop(gs, "material_mode", text="") + layout.prop(gs, "material_mode", expand=True) if gs.material_mode == 'GLSL': split = layout.split() @@ -378,7 +348,6 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel): layout = self.layout gs = context.scene.game_data - wide_ui = context.region.width > narrowui 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, "use_deprecation_warnings") - if wide_ui: - col = split.column() + col = split.column() + col.label(text="Render:") col.prop(gs, "use_frame_rate") col.prop(gs, "use_display_lists") @@ -409,12 +378,9 @@ class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel): layout = self.layout scene = context.scene - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(scene, "distance_model") - else: - layout.prop(scene, "distance_model", text="") + layout.prop(scene, "distance_model") + layout.prop(scene, "speed_of_sound", text="Speed") layout.prop(scene, "doppler_factor") @@ -441,19 +407,12 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel): scene = context.scene world = context.world space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if scene: - split.template_ID(scene, "world", new="world.new") - elif world: - split.template_ID(space, "pin_id") - else: - if scene: - layout.template_ID(scene, "world", new="world.new") - elif world: - layout.template_ID(space, "pin_id") + + split = layout.split(percentage=0.65) + if scene: + split.template_ID(scene, "world", new="world.new") + elif world: + split.template_ID(space, "pin_id") 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 world = context.world - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(world, "horizon_color") - if wide_ui: - col = split.column() + col = split.column() col.prop(world, "ambient_color") @@ -499,7 +456,6 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel): layout = self.layout world = context.world - wide_ui = context.region.width > narrowui layout.active = world.mist.use_mist split = layout.split() @@ -507,8 +463,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel): col = split.column() col.prop(world.mist, "start") - if wide_ui: - col = split.column() + col = split.column() col.prop(world.mist, "depth") @@ -525,7 +480,6 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel): layout = self.layout gs = context.scene.game_data - wide_ui = context.region.width > narrowui layout.prop(gs, "physics_engine") 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") col.prop(gs, "fps", text="FPS") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Logic Steps:") col.prop(gs, "logic_step_max", text="Max") diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index 32070dfbacf..6dfc3fc95a1 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - def active_node_mat(mat): # 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 slot = context.material_slot space = context.space_data - wide_ui = context.region.width > narrowui if ob: 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_deselect", text="Deselect") - if wide_ui: - split = layout.split(percentage=0.65) - - if ob: - split.template_ID(ob, "active_material", new="material.new") - row = split.row() - if mat: - row.prop(mat, "use_nodes", icon="NODETREE", text="") - - if slot: - row.prop(slot, "link", text="") - else: - row.label() - elif mat: - split.template_ID(space, "pin_id") - split.separator() - else: - if ob: - layout.template_ID(ob, "active_material", new="material.new") - elif mat: - layout.template_ID(space, "pin_id") + split = layout.split(percentage=0.65) - if mat: - if wide_ui: - layout.prop(mat, "type", expand=True) + if ob: + split.template_ID(ob, "active_material", new="material.new") + row = split.row() + if mat: + row.prop(mat, "use_nodes", icon="NODETREE", text="") + + if slot: + row.prop(slot, "link", text="") else: - layout.prop(mat, "type", text="") + row.label() + elif mat: + split.template_ID(space, "pin_id") + split.separator() + + if mat: + layout.prop(mat, "type", expand=True) 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 mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui if mat.type in ('SURFACE', 'WIRE'): split = layout.split() @@ -173,8 +160,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel): sub = col.column() sub.prop(mat, "translucency") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "shadeless") sub = col.column() sub.active = not mat.shadeless @@ -201,7 +187,6 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel): mat = context.material # dont use node material tan = mat.strand - wide_ui = context.region.width > narrowui split = layout.split() @@ -217,8 +202,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel): sub.prop(tan, "tangent_shading") col.prop(tan, "shape") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Shading:") col.prop(tan, "width_fade") ob = context.object @@ -247,7 +231,6 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout phys = context.material.physics # dont use node material - wide_ui = context.region.width > narrowui split = layout.split() @@ -256,8 +239,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel): col.prop(phys, "friction") col.prop(phys, "align_to_normal") - if wide_ui: - col = split.column() + col = split.column() col.prop(phys, "force", slider=True) col.prop(phys, "elasticity", slider=True) col.prop(phys, "damp", slider=True) @@ -277,7 +259,6 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui split = layout.split() @@ -297,8 +278,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel): row.active = bool(mat.light_group) row.prop(mat, "light_group_exclusive", text="Exclusive") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "face_texture") sub = col.column() sub.active = mat.face_texture @@ -324,7 +304,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui 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, "shadow_casting_alpha", text="Casting Alpha") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "cast_buffer_shadows") sub = col.column() sub.active = mat.cast_buffer_shadows @@ -361,7 +339,6 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui split = layout.split() @@ -371,8 +348,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): sub.active = (not mat.shadeless) sub.prop(mat, "diffuse_intensity", text="Intensity") - if wide_ui: - col = split.column() + col = split.column() col.active = (not mat.shadeless) col.prop(mat, "diffuse_shader", text="") col.prop(mat, "use_diffuse_ramp", text="Ramp") @@ -389,8 +365,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): col = split.column() 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") elif mat.diffuse_shader == 'FRESNEL': split = col.split() @@ -398,8 +373,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): col = split.column() col.prop(mat, "diffuse_fresnel", text="Fresnel") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "diffuse_fresnel_factor", text="Factor") if mat.use_diffuse_ramp: @@ -412,8 +386,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): col = split.column() 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") row = layout.row() row.prop(mat, "diffuse_ramp_factor", text="Factor") @@ -433,7 +406,6 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): layout = self.layout mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui 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_intensity", text="Intensity") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "specular_shader", text="") col.prop(mat, "use_specular_ramp", text="Ramp") @@ -457,8 +428,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): col = split.column() col.prop(mat, "specular_hardness", text="Hardness") - if wide_ui: - col = split.column() + col = split.column() col.prop(mat, "specular_ior", text="IOR") elif mat.specular_shader == 'WARDISO': col.prop(mat, "specular_slope", text="Slope") @@ -468,8 +438,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): col = split.column() 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") if mat.use_specular_ramp: @@ -481,8 +450,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, bpy.types.Panel): col = split.column() 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") row = layout.row() @@ -512,7 +480,6 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, bpy.types.Panel): mat = active_node_mat(context.material) sss = mat.subsurface_scattering - wide_ui = context.region.width > narrowui 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, "radius", text="RGB Radius", expand=True) - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.label(text="Blend:") 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) raym = mat.raytrace_mirror - wide_ui = context.region.width > narrowui layout.active = raym.enabled @@ -573,8 +538,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel): col.prop(raym, "reflect_factor") col.prop(mat, "mirror_color", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(raym, "fresnel") sub = col.column() sub.active = raym.fresnel > 0 @@ -592,8 +556,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel): sub.label(text="Fade To:") sub.prop(raym, "fade_to", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Gloss:") col.prop(raym, "gloss_factor", text="Amount") sub = col.column() @@ -624,14 +587,10 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): mat = active_node_mat(context.material) rayt = mat.raytrace_transparency - wide_ui = context.region.width > narrowui row = layout.row() row.active = mat.transparency and (not mat.shadeless) - if wide_ui: - row.prop(mat, "transparency_method", expand=True) - else: - row.prop(mat, "transparency_method", text="") + row.prop(mat, "transparency_method", expand=True) split = layout.split() @@ -641,8 +600,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): row.active = mat.transparency and (not mat.shadeless) row.prop(mat, "specular_alpha", text="Specular") - if wide_ui: - col = split.column() + col = split.column() col.active = (not mat.shadeless) col.prop(rayt, "fresnel") sub = col.column() @@ -661,8 +619,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): col.prop(rayt, "limit") col.prop(rayt, "depth") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Gloss:") col.prop(rayt, "gloss_factor", text="Amount") sub = col.column() @@ -692,14 +649,10 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel): mat = active_node_mat(context.material) rayt = mat.raytrace_transparency - wide_ui = context.region.width > narrowui row = layout.row() row.active = mat.transparency and (not mat.shadeless) - if wide_ui: - row.prop(mat, "transparency_method", expand=True) - else: - row.prop(mat, "transparency_method", text="") + row.prop(mat, "transparency_method", expand=True) split = layout.split() @@ -722,7 +675,6 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel): mat = context.material # dont use node material halo = mat.halo - wide_ui = context.region.width > narrowui split = layout.split() @@ -738,8 +690,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel): col.prop(halo, "shaded") col.prop(halo, "soft") - if wide_ui: - col = split.column() + col = split.column() col.prop(halo, "ring") sub = col.column() sub.active = halo.ring @@ -778,7 +729,6 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel): mat = context.material # dont use node material halo = mat.halo - wide_ui = context.region.width > narrowui 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_boost", text="Boost") 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, "flare_subsize", text="Subsize") @@ -816,14 +766,12 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel, bpy.types.Panel): layout = self.layout vol = context.material.volume # dont use node material - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(vol, "density") - if wide_ui: - col = split.column() + col = split.column() col.prop(vol, "density_scale") @@ -836,7 +784,6 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel): layout = self.layout vol = context.material.volume # dont use node material - wide_ui = context.region.width > narrowui split = layout.split() @@ -845,8 +792,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel, bpy.types.Panel): col.prop(vol, "asymmetry") col.prop(vol, "transmission_color") - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.prop(vol, "emission") sub.prop(vol, "emission_color", text="") @@ -864,15 +810,13 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, bpy.types.Panel): layout = self.layout vol = context.material.volume # dont use node material - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(vol, "lighting_mode", text="") - if wide_ui: - col = split.column() + col = split.column() if vol.lighting_mode == 'SHADED': col.prop(vol, "external_shadows") @@ -901,12 +845,8 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel, bpy.types.Panel): layout = self.layout mat = context.material # dont use node material - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(mat, "transparency_method", expand=True) - else: - layout.prop(mat, "transparency_method", text="") + layout.prop(mat, "transparency_method", expand=True) 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 vol = context.material.volume # dont use node material - wide_ui = context.region.width > narrowui split = layout.split() @@ -928,8 +867,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, bpy.types.Panel): col = col.column(align=True) col.prop(vol, "step_size") - if wide_ui: - col = split.column() + col = split.column() col.label() col.prop(vol, "depth_cutoff") @@ -943,7 +881,6 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, bpy.types.Panel): layout = self.layout mat = active_node_mat(context.material) - wide_ui = context.region.width > narrowui split = layout.split() diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py index 603ac76120d..f5d61a22b8f 100644 --- a/release/scripts/ui/properties_object.py +++ b/release/scripts/ui/properties_object.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class ObjectButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -53,37 +51,23 @@ class OBJECT_PT_transform(ObjectButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui - if wide_ui: - row = layout.row() + row = layout.row() - row.column().prop(ob, "location") - if ob.rotation_mode == 'QUATERNION': - row.column().prop(ob, "rotation_quaternion", text="Rotation") - elif ob.rotation_mode == 'AXIS_ANGLE': - #row.column().label(text="Rotation") - #row.column().prop(pchan, "rotation_angle", text="Angle") - #row.column().prop(pchan, "rotation_axis", text="Axis") - row.column().prop(ob, "rotation_axis_angle", text="Rotation") - else: - row.column().prop(ob, "rotation_euler", text="Rotation") + row.column().prop(ob, "location") + if ob.rotation_mode == 'QUATERNION': + row.column().prop(ob, "rotation_quaternion", text="Rotation") + elif ob.rotation_mode == 'AXIS_ANGLE': + #row.column().label(text="Rotation") + #row.column().prop(pchan, "rotation_angle", text="Angle") + #row.column().prop(pchan, "rotation_axis", text="Axis") + row.column().prop(ob, "rotation_axis_angle", text="Rotation") + else: + row.column().prop(ob, "rotation_euler", text="Rotation") - row.column().prop(ob, "scale") + row.column().prop(ob, "scale") - layout.prop(ob, "rotation_mode") - else: - col = layout.column() - col.prop(ob, "location") - col.label(text="Rotation:") - col.prop(ob, "rotation_mode", text="") - if ob.rotation_mode == 'QUATERNION': - 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") + layout.prop(ob, "rotation_mode") 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 ob = context.object - # wide_ui = context.region.width > narrowui row = layout.row() @@ -120,7 +103,6 @@ class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -129,8 +111,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, bpy.types.Panel): col.separator() col.prop(ob, "pass_index") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Parent:") col.prop(ob, "parent", text="") @@ -149,7 +130,6 @@ class OBJECT_PT_groups(ObjectButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui row = layout.row(align=True) 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.prop(group, "layer", text="Dupli") - if wide_ui: - col = split.column() + col = split.column() col.prop(group, "dupli_offset", text="") 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 ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(ob, "max_draw_type", text="Type") - if wide_ui: - col = split.column() + col = split.column() row = col.row() row.prop(ob, "draw_bounds", text="Bounds") 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, "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, "x_ray", text="X-Ray") col.prop(ob, "draw_transparent", text="Transparency") @@ -226,12 +202,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel): layout = self.layout ob = context.object - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(ob, "dupli_type", expand=True) - else: - layout.prop(ob, "dupli_type", text="") + layout.prop(ob, "dupli_type", expand=True) if ob.dupli_type == 'FRAMES': 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_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_off", text="Off") @@ -256,15 +227,12 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, bpy.types.Panel): col = split.column() 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") elif ob.dupli_type == 'GROUP': - if wide_ui: - layout.prop(ob, "dupli_group", text="Group") - else: - layout.prop(ob, "dupli_group", text="") + layout.prop(ob, "dupli_group", text="Group") + # 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 ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -295,8 +262,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel, bpy.types.Panel): col.prop(ob, "time_offset", text="Offset") # 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.prop(ob, "track_axis", text="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 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() @@ -327,8 +292,7 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, bpy.types.Panel): col = split.column() 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") @@ -344,9 +308,8 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): #, bpy.types.Panel): # in layout = self.layout 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): _context_path = "object" diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py index b5352abafa7..87ca702fa69 100644 --- a/release/scripts/ui/properties_object_constraint.py +++ b/release/scripts/ui/properties_object_constraint.py @@ -19,9 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check -narrowcon = 260 - class ConstraintButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -31,52 +28,38 @@ class ConstraintButtonsPanel(): def draw_constraint(self, context, con): layout = self.layout - wide_ui = context.region.width > narrowui - compact_con = context.region.width < narrowcon - box = layout.template_constraint(con, compact=compact_con) + box = layout.template_constraint(con) if box: # 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'): 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: split = layout.split(percentage=0.2) - if wide_ui: - split.label(text="Space:") - row = split.row() - else: - row = layout.row() - + split.label(text="Space:") + row = split.row() if target: row.prop(con, "target_space", text="") - if wide_ui: - if target and owner: - row.label(icon='ARROW_LEFTRIGHT') - else: - row = layout.row() + if target and owner: + row.label(icon='ARROW_LEFTRIGHT') + if owner: row.prop(con, "owner_space", text="") - def target_template(self, layout, con, wide_ui, subtargets=True): - if wide_ui: - layout.prop(con, "target") # XXX limiting settings for only 'curves' or some type of object - else: - layout.prop(con, "target", text="") + def target_template(self, layout, con, subtargets=True): + layout.prop(con, "target") # XXX limiting settings for only 'curves' or some type of object if con.target and subtargets: if con.target.type == 'ARMATURE': - if wide_ui: - layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone") - else: - layout.prop_object(con, "subtarget", con.target.data, "bones", text="") + layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone") if con.type in ('COPY_LOCATION', 'STRETCH_TO', 'TRACK_TO', 'PIVOT'): row = layout.row() @@ -85,7 +68,7 @@ class ConstraintButtonsPanel(): elif con.target.type in ('MESH', 'LATTICE'): 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 layout.prop(con, "pole_target") @@ -106,8 +89,8 @@ class ConstraintButtonsPanel(): col.prop(con, "chain_length") col.prop(con, "use_target") - def CHILD_OF(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def CHILD_OF(self, context, layout, con): + self.target_template(layout, con) split = layout.split() @@ -134,16 +117,14 @@ class ConstraintButtonsPanel(): col = split.column() col.operator("constraint.childof_set_inverse") - if wide_ui: - col = split.column() + col = split.column() col.operator("constraint.childof_clear_inverse") - def TRACK_TO(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def TRACK_TO(self, context, layout, con): + self.target_template(layout, con) row = layout.row() - if wide_ui: - row.label(text="To:") + row.label(text="To:") row.prop(con, "track", expand=True) split = layout.split() @@ -151,34 +132,27 @@ class ConstraintButtonsPanel(): col = split.column() col.prop(con, "up", text="Up") - if wide_ui: - col = split.column() + col = split.column() 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": 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: # Legacy IK constraint - self.target_template(layout, con, wide_ui) - if wide_ui: - layout.prop(con, "pole_target") - else: - layout.prop(con, "pole_target", text="") + self.target_template(layout, con) + layout.prop(con, "pole_target") + 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") - else: - layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="") + layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") if con.pole_target: row = layout.row() row.prop(con, "pole_angle") - if wide_ui: - row.label() + row.label() split = layout.split() col = split.column() @@ -191,17 +165,16 @@ class ConstraintButtonsPanel(): sub.active = con.use_rotation 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_stretch") col.separator() col.prop(con, "use_target") col.prop(con, "use_rotation") - def IK_COPY_POSE(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) - self.ik_template(layout, con, wide_ui) + def IK_COPY_POSE(self, context, layout, con): + self.target_template(layout, con) + self.ik_template(layout, con) row = layout.row() row.label(text="Axis Ref:") @@ -234,17 +207,17 @@ class ConstraintButtonsPanel(): row.prop(con, "rot_lock_z", text="Z") split.active = con.use_rotation - def IK_DISTANCE(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) - self.ik_template(layout, con, wide_ui) + def IK_DISTANCE(self, context, layout, con): + self.target_template(layout, con) + self.ik_template(layout, con) layout.prop(con, "limit_mode") row = layout.row() row.prop(con, "weight", text="Weight", slider=True) row.prop(con, "distance", text="Distance", slider=True) - def FOLLOW_PATH(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def FOLLOW_PATH(self, context, layout, con): + self.target_template(layout, con) split = layout.split() @@ -252,8 +225,7 @@ class ConstraintButtonsPanel(): col.prop(con, "use_curve_follow") col.prop(con, "use_curve_radius") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_fixed_position") if con.use_fixed_position: col.prop(con, "offset_factor", text="Offset") @@ -261,16 +233,14 @@ class ConstraintButtonsPanel(): col.prop(con, "offset") row = layout.row() - if wide_ui: - row.label(text="Forward:") + row.label(text="Forward:") row.prop(con, "forward", expand=True) row = layout.row() 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() @@ -281,16 +251,14 @@ class ConstraintButtonsPanel(): sub.prop(con, "minimum_x", text="Min") 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") sub = col.column() sub.active = con.use_limit_y sub.prop(con, "minimum_y", text="Min") 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") sub = col.column() sub.active = con.use_limit_z @@ -299,15 +267,13 @@ class ConstraintButtonsPanel(): row = layout.row() row.prop(con, "limit_transform") - if wide_ui: - row.label() + row.label() row = layout.row() - if wide_ui: - row.label(text="Convert:") + row.label(text="Convert:") 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() col = split.column() @@ -320,8 +286,7 @@ class ConstraintButtonsPanel(): sub.active = con.use_maximum_x sub.prop(con, "maximum_x", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_minimum_y") sub = col.column() sub.active = con.use_minimum_y @@ -331,8 +296,7 @@ class ConstraintButtonsPanel(): sub.active = con.use_maximum_y sub.prop(con, "maximum_y", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_minimum_z") sub = col.column() sub.active = con.use_minimum_z @@ -344,15 +308,13 @@ class ConstraintButtonsPanel(): row = layout.row() row.prop(con, "limit_transform") - if wide_ui: - row.label() + row.label() row = layout.row() - if wide_ui: - row.label(text="Convert:") + row.label(text="Convert:") 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() col = split.column() @@ -365,8 +327,7 @@ class ConstraintButtonsPanel(): sub.active = con.use_maximum_x sub.prop(con, "maximum_x", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_minimum_y") sub = col.column() sub.active = con.use_minimum_y @@ -376,8 +337,7 @@ class ConstraintButtonsPanel(): sub.active = con.use_maximum_y sub.prop(con, "maximum_y", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_minimum_z") sub = col.column() sub.active = con.use_minimum_z @@ -389,16 +349,14 @@ class ConstraintButtonsPanel(): row = layout.row() row.prop(con, "limit_transform") - if wide_ui: - row.label() + row.label() row = layout.row() - if wide_ui: - row.label(text="Convert:") + row.label(text="Convert:") row.prop(con, "owner_space", text="") - def COPY_ROTATION(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def COPY_ROTATION(self, context, layout, con): + self.target_template(layout, con) split = layout.split() @@ -422,10 +380,10 @@ class ConstraintButtonsPanel(): 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): - self.target_template(layout, con, wide_ui) + def COPY_LOCATION(self, context, layout, con): + self.target_template(layout, con) split = layout.split() @@ -449,10 +407,10 @@ class ConstraintButtonsPanel(): 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): - self.target_template(layout, con, wide_ui) + def COPY_SCALE(self, context, layout, con): + self.target_template(layout, con) row = layout.row(align=True) row.prop(con, "use_x", text="X") @@ -461,38 +419,31 @@ class ConstraintButtonsPanel(): 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() - if wide_ui: - row.label(text="Free:") + row.label(text="Free:") row.prop(con, "axis", expand=True) 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): - self.target_template(layout, con, wide_ui) + def COPY_TRANSFORMS(self, context, layout, con): + self.target_template(layout, con) - self.space_template(layout, con, wide_ui) + self.space_template(layout, con) #def SCRIPT(self, context, layout, con): - def ACTION(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def ACTION(self, context, layout, con): + self.target_template(layout, con) - if wide_ui: - layout.prop(con, "action") - else: - layout.prop(con, "action", text="") + layout.prop(con, "action") - if wide_ui: - layout.prop(con, "transform_channel") - else: - layout.prop(con, "transform_channel", text="") + layout.prop(con, "transform_channel") split = layout.split() @@ -501,32 +452,28 @@ class ConstraintButtonsPanel(): col.prop(con, "frame_start", text="Start") 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.prop(con, "minimum", text="Min") col.prop(con, "maximum", text="Max") row = layout.row() - if wide_ui: - row.label(text="Convert:") + row.label(text="Convert:") row.prop(con, "target_space", text="") - def LOCKED_TRACK(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def LOCKED_TRACK(self, context, layout, con): + self.target_template(layout, con) row = layout.row() - if wide_ui: - row.label(text="To:") + row.label(text="To:") row.prop(con, "track", expand=True) row = layout.row() - if wide_ui: - row.label(text="Lock:") + row.label(text="Lock:") row.prop(con, "lock", expand=True) - def LIMIT_DISTANCE(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def LIMIT_DISTANCE(self, context, layout, con): + self.target_template(layout, con) col = layout.column(align=True) col.prop(con, "distance") @@ -536,70 +483,58 @@ class ConstraintButtonsPanel(): row.label(text="Clamp Region:") row.prop(con, "limit_mode", text="") - def STRETCH_TO(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def STRETCH_TO(self, context, layout, con): + self.target_template(layout, con) split = layout.split() col = split.column() 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 = layout.column() col.prop(con, "bulge", text="Volume Variation") row = layout.row() - if wide_ui: - row.label(text="Volume:") + row.label(text="Volume:") row.prop(con, "volume", expand=True) - if not wide_ui: - row = layout.row() + row.label(text="Plane:") row.prop(con, "keep_axis", expand=True) - def FLOOR(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def FLOOR(self, context, layout, con): + self.target_template(layout, con) split = layout.split() col = split.column() col.prop(con, "sticky") - if wide_ui: - col = split.column() + col = split.column() col.prop(con, "use_rotation") layout.prop(con, "offset") row = layout.row() - if wide_ui: - row.label(text="Min/Max:") + row.label(text="Min/Max:") 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): - self.target_template(layout, con, wide_ui) + def RIGID_BODY_JOINT(self, context, layout, con): + self.target_template(layout, con) - if wide_ui: - layout.prop(con, "pivot_type") - else: - layout.prop(con, "pivot_type", text="") - if wide_ui: - layout.prop(con, "child") - else: - layout.prop(con, "child", text="") + layout.prop(con, "pivot_type") + layout.prop(con, "child") split = layout.split() col = split.column() 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") split = layout.split() @@ -610,8 +545,7 @@ class ConstraintButtonsPanel(): col.prop(con, "pivot_y", text="Y") 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.prop(con, "axis_x", text="X") col.prop(con, "axis_y", text="Y") @@ -619,19 +553,18 @@ class ConstraintButtonsPanel(): #Missing: Limit arrays (not wrapped in RNA yet) - def CLAMP_TO(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def CLAMP_TO(self, context, layout, con): + self.target_template(layout, con) row = layout.row() - if wide_ui: - row.label(text="Main Axis:") + row.label(text="Main Axis:") row.prop(con, "main_axis", expand=True) row = layout.row() row.prop(con, "cyclic") - def TRANSFORM(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def TRANSFORM(self, context, layout, con): + self.target_template(layout, con) 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_max_x", text="Max") - if wide_ui: - sub = split.column(align=True) + sub = split.column(align=True) sub.label(text="Y:") sub.prop(con, "from_min_y", text="Min") 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.prop(con, "from_min_z", text="Min") 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_max_x", text="Max") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Y:") 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_max_y", text="Max") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Z:") 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_max_z", text="Max") - self.space_template(layout, con, wide_ui) + self.space_template(layout, con) - def SHRINKWRAP(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def SHRINKWRAP(self, context, layout, con): + self.target_template(layout, con) layout.prop(con, "distance") layout.prop(con, "shrinkwrap_type") @@ -706,16 +635,15 @@ class ConstraintButtonsPanel(): row.prop(con, "use_y") row.prop(con, "use_z") - def DAMPED_TRACK(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def DAMPED_TRACK(self, context, layout, con): + self.target_template(layout, con) row = layout.row() - if wide_ui: - row.label(text="To:") + row.label(text="To:") row.prop(con, "track", expand=True) - def SPLINE_IK(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def SPLINE_IK(self, context, layout, con): + self.target_template(layout, con) col = layout.column() col.label(text="Spline Fitting:") @@ -726,14 +654,11 @@ class ConstraintButtonsPanel(): col = layout.column() col.label(text="Chain Scaling:") col.prop(con, "y_stretch") - if wide_ui: - col.prop(con, "xz_scaling_mode") - else: - col.prop(con, "xz_scaling_mode", text="") + col.prop(con, "xz_scaling_mode") col.prop(con, "use_curve_radius") - def PIVOT(self, context, layout, con, wide_ui): - self.target_template(layout, con, wide_ui) + def PIVOT(self, context, layout, con): + self.target_template(layout, con) if con.target: col = layout.column() diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py index e135b12b844..0d830c121ee 100644 --- a/release/scripts/ui/properties_particle.py +++ b/release/scripts/ui/properties_particle.py @@ -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_falloff_ui -narrowui = bpy.context.user_preferences.view.properties_width_check - def particle_panel_enabled(context, psys): 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 part = psys.settings - wide_ui = context.region.width > narrowui 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:") row = layout.row() - if wide_ui: - row.prop(part, "emit_from", expand=True) - else: - row.prop(part, "emit_from", text="") + row.prop(part, "emit_from", expand=True) + row = layout.row() row.prop(part, "trand") 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': row = layout.row() - if wide_ui: - row.prop(part, "distribution", expand=True) - else: - row.prop(part, "distribution", text="") + + row.prop(part, "distribution", expand=True) row = layout.row() @@ -353,7 +346,6 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel): psys = context.particle_system part = psys.settings - wide_ui = context.region.width > narrowui 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) layout.row().label(text="Angular Velocity:") - if wide_ui: - layout.row().prop(part, "angular_velocity_mode", expand=True) - else: - layout.row().prop(part, "angular_velocity_mode", text="") + layout.row().prop(part, "angular_velocity_mode", expand=True) split = layout.split() sub = split.column() @@ -399,15 +388,11 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel): psys = context.particle_system part = psys.settings - wide_ui = context.region.width > narrowui layout.enabled = particle_panel_enabled(context, psys) row = layout.row() - if wide_ui: - row.prop(part, "physics_type", expand=True) - else: - row.prop(part, "physics_type", text="") + row.prop(part, "physics_type", expand=True) row = layout.row() col = row.column(align=True) @@ -701,7 +686,6 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): psys = context.particle_system part = psys.settings - wide_ui = context.region.width > narrowui row = layout.row() row.prop(part, "material") @@ -717,10 +701,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): sub.prop(part, "died") row = layout.row() - if wide_ui: - row.prop(part, "ren_as", expand=True) - else: - row.prop(part, "ren_as", text="") + row.prop(part, "ren_as", expand=True) split = layout.split() @@ -807,10 +788,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): sub.label(text="Align:") row = layout.row() - if wide_ui: - row.prop(part, "billboard_align", expand=True) - else: - row.prop(part, "billboard_align", text="") + row.prop(part, "billboard_align", expand=True) row.prop(part, "billboard_lock", text="Lock") row = layout.row() row.prop(part, "billboard_object") @@ -873,13 +851,9 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel): psys = context.particle_system part = psys.settings - wide_ui = context.region.width > narrowui row = layout.row() - if wide_ui: - row.prop(part, "draw_as", expand=True) - else: - row.prop(part, "draw_as", text="") + row.prop(part, "draw_as", expand=True) if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'): return @@ -927,12 +901,8 @@ class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel): psys = context.particle_system part = psys.settings - wide_ui = context.region.width > narrowui - if wide_ui: - layout.row().prop(part, "child_type", expand=True) - else: - layout.row().prop(part, "child_type", text="") + layout.row().prop(part, "child_type", expand=True) if part.child_type == 'NONE': return @@ -988,10 +958,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, bpy.types.Panel): col.label(text="hair parting controls") layout.row().label(text="Kink:") - if wide_ui: - layout.row().prop(part, "kink", expand=True) - else: - layout.row().prop(part, "kink", text="") + layout.row().prop(part, "kink", expand=True) split = layout.split() diff --git a/release/scripts/ui/properties_physics_cloth.py b/release/scripts/ui/properties_physics_cloth.py index 5845253db11..d711dc9d9cf 100644 --- a/release/scripts/ui/properties_physics_cloth.py +++ b/release/scripts/ui/properties_physics_cloth.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - from properties_physics_common import point_cache_ui from properties_physics_common import effector_weights_ui @@ -60,7 +58,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel): md = context.cloth ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -75,8 +72,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, bpy.types.Panel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'CLOTH' - if wide_ui: - split.label() + split.label() if md: 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, "bending_stiffness", text="Bending") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Damping:") 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 md = context.cloth - wide_ui = context.region.width > narrowui 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, "friction") - if wide_ui: - col = split.column() + col = split.column() col.prop(cloth, "enable_self_collision", text="Self Collision") sub = col.column() sub.active = cloth.enable_self_collision @@ -208,7 +201,6 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, bpy.types.Panel): md = context.cloth ob = context.object cloth = context.cloth.settings - wide_ui = context.region.width > narrowui 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(cloth, "structural_stiffness_max", text="Max") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Bending Stiffness:") col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="") col.prop(cloth, "bending_stiffness_max", text="Max") diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py index be8972e4fe6..340cd88251c 100644 --- a/release/scripts/ui/properties_physics_common.py +++ b/release/scripts/ui/properties_physics_common.py @@ -20,15 +20,12 @@ import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc def point_cache_ui(self, context, cache, enabled, cachetype): layout = self.layout - wide_ui = context.region.width > narrowui layout.set_context_pointer("point_cache", cache) row = layout.row() @@ -66,8 +63,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): if cachetype != 'SMOKE': col.prop(cache, "step") - if wide_ui: - col = split.column() + col = split.column() if cachetype != 'SMOKE': 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") - if wide_ui: - col = split.column() + col = split.column() col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True col.operator("ptcache.free_bake_all", text="Free All Bakes") 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): layout = self.layout - wide_ui = context.region.width > narrowui layout.prop(weights, "group") @@ -121,8 +115,7 @@ def effector_weights_ui(self, context, weights): col = split.column() col.prop(weights, "gravity", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.prop(weights, "all", slider=True) layout.separator() @@ -137,8 +130,7 @@ def effector_weights_ui(self, context, weights): col.prop(weights, "curveguide", 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, "charge", 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): layout = self.layout - wide_ui = context.region.width > narrowui split = layout.split() @@ -177,8 +168,7 @@ def basic_force_field_settings_ui(self, context, field): else: col.prop(field, "flow") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "noise") col.prop(field, "seed") 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_rotation") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Collision:") 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): layout = self.layout - wide_ui = context.region.width > narrowui # XXX: This doesn't update for some reason. - #if wide_ui: - # split = layout.split() - #else: + #split = layout.split() split = layout.split(percentage=0.35) 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_max_distance", text="Use Maximum") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "falloff_power", text="Power") sub = col.column() diff --git a/release/scripts/ui/properties_physics_field.py b/release/scripts/ui/properties_physics_field.py index 58537847b8a..bf9fb1ab996 100644 --- a/release/scripts/ui/properties_physics_field.py +++ b/release/scripts/ui/properties_physics_field.py @@ -19,8 +19,6 @@ # <pep8 compliant> 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_falloff_ui @@ -45,22 +43,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel): ob = context.object field = ob.field - wide_ui = context.region.width > narrowui - if wide_ui: - split = layout.split(percentage=0.2) - split.label(text="Type:") - else: - split = layout.split() + split = layout.split(percentage=0.2) + split.label(text="Type:") split.prop(field, "type", text="") if field.type not in ('NONE', 'GUIDE', 'TEXTURE'): - if wide_ui: - split = layout.split(percentage=0.2) - split.label(text="Shape:") - else: - split = layout.split() + split = layout.split(percentage=0.2) + split.label(text="Shape:") split.prop(field, "shape", text="") split = layout.split() @@ -75,8 +66,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel): col.prop(field, "guide_path_add") col.prop(field, "use_guide_path_weight") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Clumping:") col.prop(field, "guide_clump_amount") 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_shape") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "guide_kink_amplitude") 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_nabla") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "use_coordinates") col.prop(field, "root_coordinates") 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_max", text="Use Maximum") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "radial_falloff", text="Power") 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_max", text="Use Maximum") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "radial_falloff", text="Power") sub = col.column() @@ -184,7 +170,6 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel): layout = self.layout md = context.collision - wide_ui = context.region.width > narrowui split = layout.split() @@ -192,8 +177,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel): # remove modifier + settings split.set_context_pointer("modifier", md) split.operator("object.modifier_remove", text="Remove") - if wide_ui: - col = split.column() + col = split.column() #row = split.row(align=True) #row.prop(md, "render", text="") @@ -204,8 +188,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, bpy.types.Panel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'COLLISION' - if wide_ui: - split.label() + split.label() 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, "random_friction", text="Random", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.label(text="Soft Body and Cloth:") sub = col.column(align=True) sub.prop(settings, "outer_thickness", text="Outer", slider=True) diff --git a/release/scripts/ui/properties_physics_fluid.py b/release/scripts/ui/properties_physics_fluid.py index 110e652a9ee..7f0352fa052 100644 --- a/release/scripts/ui/properties_physics_fluid.py +++ b/release/scripts/ui/properties_physics_fluid.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class PhysicButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -41,7 +39,6 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel): layout = self.layout md = context.fluid - wide_ui = context.region.width > narrowui split = layout.split() @@ -59,22 +56,16 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION' - if wide_ui: - split.label() + split.label() fluid = None if fluid: - if wide_ui: - row = layout.row() - row.prop(fluid, "type") - if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): - row.prop(fluid, "active", text="") - else: - layout.prop(fluid, "type", text="") - if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): - layout.prop(fluid, "active", text="") + row = layout.row() + row.prop(fluid, "type") + if fluid.type not in ('NONE', 'DOMAIN', 'PARTICLE'): + row.prop(fluid, "active", text="") layout = layout.column() 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.prop(fluid, "render_display_mode", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Required Memory: " + fluid.memory_estimate) col.prop(fluid, "preview_resolution", text="Preview") 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, "end_time", text="End") - if wide_ui: - col = split.column() - col.label() + col = split.column() + col.label() col.prop(fluid, "generate_speed_vectors") 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, "export_animated_mesh") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Initial Velocity:") 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, "export_animated_mesh") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Slip Type:") col.prop(fluid, "slip_type", text="") 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, "local_coordinates") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Inflow Velocity:") 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, "export_animated_mesh") - if wide_ui: - split.column() + split.column() elif fluid.type == 'PARTICLE': 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, "alpha_influence", text="Alpha") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Type:") col.prop(fluid, "drops") 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, "reverse_frames") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Time:") sub = col.column(align=True) 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_radius", text="Radius") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Velocity Force:") sub = col.column(align=True) sub.prop(fluid, "velocity_strength", text="Strength") @@ -231,7 +213,6 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel): fluid = context.fluid.settings scene = context.scene - wide_ui = context.region.width > narrowui split = layout.split() @@ -254,8 +235,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, bpy.types.Panel): col.label(text="Real World Size:") col.prop(fluid, "real_world_size", text="Metres") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Viscosity Presets:") sub = col.column(align=True) sub.prop(fluid, "viscosity_preset", text="") @@ -282,7 +262,6 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel): layout = self.layout fluid = context.fluid.settings - wide_ui = context.region.width > narrowui split = layout.split() @@ -292,8 +271,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel): if fluid.slip_type == 'PARTIALSLIP': col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Surface:") col.prop(fluid, "surface_smoothing", text="Smoothing") col.prop(fluid, "surface_subdivisions", text="Subdivisions") diff --git a/release/scripts/ui/properties_physics_smoke.py b/release/scripts/ui/properties_physics_smoke.py index a05226b3845..4831bafa490 100644 --- a/release/scripts/ui/properties_physics_smoke.py +++ b/release/scripts/ui/properties_physics_smoke.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - from properties_physics_common import point_cache_ui from properties_physics_common import effector_weights_ui @@ -46,7 +44,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel): md = context.smoke ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -62,14 +59,10 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'SMOKE' - if wide_ui: - split.label() + split.label() if md: - if wide_ui: - layout.prop(md, "smoke_type", expand=True) - else: - layout.prop(md, "smoke_type", text="") + layout.prop(md, "smoke_type", expand=True) if md.smoke_type == 'DOMAIN': domain = md.domain_settings @@ -84,8 +77,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel): col.label(text="Border Collisions:") col.prop(domain, "smoke_domain_colli", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Behavior:") col.prop(domain, "alpha") col.prop(domain, "beta") @@ -115,8 +107,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel): sub.active = flow.initial_velocity sub.prop(flow, "velocity_multiplier", text="Multiplier") - if wide_ui: - sub = split.column() + + sub = split.column() sub.active = not md.flow_settings.outflow sub.label(text="Behavior:") sub.prop(flow, "temperature") @@ -140,7 +132,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel): layout = self.layout group = context.smoke.domain_settings - wide_ui = context.region.width > narrowui split = layout.split() @@ -151,8 +142,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel): #col.label(text="Effector Group:") #col.prop(group, "eff_group", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Collision Group:") col.prop(group, "coll_group", text="") @@ -196,7 +186,6 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel): layout = self.layout md = context.smoke.domain_settings - wide_ui = context.region.width > narrowui layout.active = md.highres @@ -208,8 +197,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel): col.prop(md, "smoothemitter") col.prop(md, "viewhighres") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Noise Method:") col.row().prop(md, "noise_type", text="") col.prop(md, "strength") diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py index e7dc39bbaf7..50e0910adc9 100644 --- a/release/scripts/ui/properties_physics_softbody.py +++ b/release/scripts/ui/properties_physics_softbody.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - from properties_physics_common import point_cache_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 ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -67,8 +64,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'SOFT_BODY' - if wide_ui: - split.column() + split.column() if md: softbody = md.settings @@ -83,8 +79,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy.types.Panel): col.prop(softbody, "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.prop(softbody, "speed") @@ -122,7 +117,6 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, bpy.types.Panel): md = context.soft_body softbody = md.settings ob = context.object - wide_ui = context.region.width > narrowui 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_max", text="Maximum") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Goal Settings:") col.prop(softbody, "goal_spring", text="Stiffness") col.prop(softbody, "goal_friction", text="Damping") @@ -167,7 +160,6 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, bpy.types.Panel): md = context.soft_body softbody = md.settings ob = context.object - wide_ui = context.region.width > narrowui 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_object(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:") - if wide_ui: - col = split.column() + col = split.column() col.prop(softbody, "stiff_quads") sub = col.column() sub.active = softbody.stiff_quads @@ -222,15 +213,11 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, bpy.types.Panel): md = context.soft_body softbody = md.settings - wide_ui = context.region.width > narrowui layout.active = softbody.self_collision and softbody_panel_enabled(md) layout.label(text="Collision Ball Size Calculation:") - if wide_ui: - layout.prop(softbody, "collision_type", expand=True) - else: - layout.prop(softbody, "collision_type", text="") + layout.prop(softbody, "collision_type", expand=True) col = layout.column(align=True) col.label(text="Ball:") @@ -252,7 +239,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, bpy.types.Panel): md = context.soft_body softbody = md.settings - wide_ui = context.region.width > narrowui 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, "auto_step", text="Auto-Step") - if wide_ui: - col = split.column() + col = split.column() col.prop(softbody, "error_limit") col.label(text="Helpers:") col.prop(softbody, "choke") diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index dc0b76645ae..7b080445aee 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class RENDER_MT_presets(bpy.types.Menu): bl_label = "Render Presets" @@ -56,15 +54,13 @@ class RENDER_PT_render(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() 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 layout.prop(rd, "display_mode", text="Display") @@ -85,7 +81,6 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel): scene = context.scene rd = scene.render - wide_ui = context.region.width > narrowui row = layout.row() 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.prop(rl, "light_override", text="Light") col.prop(rl, "material_override", text="Material") - if wide_ui: - col = split.column() + + col = split.column() col.prop(rl, "visible_layers", text="Layer") col.label(text="Mask Layers:") 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_color") - if wide_ui: - col = split.column() + col = split.column() col.label() col.prop(rl, "pass_diffuse") row = col.row() @@ -193,7 +187,6 @@ class RENDER_PT_shading(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui 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_envmaps", text="Environment Map") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "use_raytracing", text="Ray Tracing") col.prop(rd, "color_management") col.prop(rd, "alpha_mode", text="Alpha") @@ -224,7 +216,6 @@ class RENDER_PT_performance(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui 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_y", text="Y") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Memory:") sub = col.column() 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 rd = context.scene.render - wide_ui = context.region.width > narrowui 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_sequencer") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "dither_intensity", text="Dither", slider=True) layout.separator() @@ -297,10 +285,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel): sub.prop(rd, "fields_still", text="Still") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.prop(rd, "edge") sub = col.column() sub.active = rd.edge @@ -322,7 +307,6 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): rd = context.scene.render file_format = rd.file_format - wide_ui = context.region.width > narrowui 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.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_overwrite") col.prop(rd, "use_placeholder") @@ -351,8 +334,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): col = split.column() col.label(text="Codec:") col.prop(rd, "exr_codec", text="") - if wide_ui: - col = split.column() + col = split.column() elif file_format == 'OPEN_EXR': split = layout.split() @@ -361,14 +343,12 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): col.label(text="Codec:") col.prop(rd, "exr_codec", text="") - if wide_ui: - subsplit = split.split() - col = subsplit.column() + subsplit = split.split() + col = subsplit.column() col.prop(rd, "exr_half") col.prop(rd, "exr_zbuf") - if wide_ui: - col = subsplit.column() + col = subsplit.column() col.prop(rd, "exr_preview") elif file_format == 'JPEG2000': @@ -377,8 +357,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): col.label(text="Depth:") 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_ycc") @@ -387,8 +366,7 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): col = split.column() 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.prop(rd, "cineon_black", text="Black") col.prop(rd, "cineon_white", text="White") @@ -415,21 +393,22 @@ class RENDER_PT_output(RenderButtonsPanel, bpy.types.Panel): col = split.column() if rd.quicktime_audiocodec_type == 'LPCM': col.prop(rd, "quicktime_audio_bitdepth", text="") - if wide_ui: - col = split.column() + + col = split.column() col.prop(rd, "quicktime_audio_samplerate", text="") split = layout.split() col = split.column() if rd.quicktime_audiocodec_type == 'AAC': col.prop(rd, "quicktime_audio_bitrate") - if wide_ui: - subsplit = split.split() - col = subsplit.column() + + subsplit = split.split() + col = subsplit.column() + if rd.quicktime_audiocodec_type == 'AAC': col.prop(rd, "quicktime_audio_codec_isvbr") - if wide_ui: - col = subsplit.column() + + col = subsplit.column() col.prop(rd, "quicktime_audio_resampling_hq") @@ -447,7 +426,6 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") @@ -456,19 +434,17 @@ class RENDER_PT_encoding(RenderButtonsPanel, bpy.types.Panel): col = split.column() col.prop(rd, "ffmpeg_format") if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'): - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "ffmpeg_codec") else: - if wide_ui: - split.label() + split.label() split = layout.split() col = split.column() col.prop(rd, "ffmpeg_video_bitrate") - if wide_ui: - col = split.column() + + col = split.column() col.prop(rd, "ffmpeg_gopsize") 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_buffersize", text="Buffer") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "ffmpeg_autosplit") 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_mixrate") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "ffmpeg_audio_volume", slider=True) @@ -524,7 +498,6 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui layout.active = rd.render_antialiasing split = layout.split() @@ -535,8 +508,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, bpy.types.Panel): sub.enabled = not rd.use_border sub.prop(rd, "full_sample") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "pixel_filter", text="") col.prop(rd, "filter_size", text="Size") @@ -580,7 +552,6 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel): scene = context.scene rd = scene.render - wide_ui = context.region.width > narrowui row = layout.row(align=True) 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.prop(rd, "crop_to_border", text="Crop") - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.label(text="Frame Range:") sub.prop(scene, "frame_start", text="Start") @@ -637,7 +607,6 @@ class RENDER_PT_stamp(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui 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_sequencer_strip", text="Seq. Strip") - if wide_ui: - col = split.column() + col = split.column() col.active = rd.render_stamp col.prop(rd, "stamp_foreground", slider=True) col.prop(rd, "stamp_background", slider=True) @@ -683,20 +651,13 @@ class RENDER_PT_bake(RenderButtonsPanel, bpy.types.Panel): layout = self.layout rd = context.scene.render - wide_ui = context.region.width > narrowui layout.operator("object.bake_image", icon='RENDER_STILL') - if wide_ui: - layout.prop(rd, "bake_type") - else: - layout.prop(rd, "bake_type", text="") + layout.prop(rd, "bake_type") if rd.bake_type == 'NORMALS': - if wide_ui: - layout.prop(rd, "bake_normal_space") - else: - layout.prop(rd, "bake_normal_space", text="") + layout.prop(rd, "bake_normal_space") elif rd.bake_type in ('DISPLACEMENT', 'AO'): 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_quad_split", text="Split") - if wide_ui: - col = split.column() + col = split.column() col.prop(rd, "bake_active") sub = col.column() sub.active = rd.bake_active diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index a92df6f8203..37af2b511b8 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class SceneButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -39,15 +37,10 @@ class SCENE_PT_scene(SceneButtonsPanel, bpy.types.Panel): def draw(self, context): layout = self.layout - wide_ui = context.region.width > narrowui scene = context.scene - if wide_ui: - layout.prop(scene, "camera") - layout.prop(scene, "set", text="Background") - else: - layout.prop(scene, "camera", text="") - layout.prop(scene, "set", text="") + layout.prop(scene, "camera") + layout.prop(scene, "set", text="Background") 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): layout = self.layout - wide_ui = context.region.width > narrowui unit = context.scene.unit_settings col = layout.column() @@ -72,8 +64,7 @@ class SCENE_PT_unit(SceneButtonsPanel, bpy.types.Panel): col = split.column() col.prop(unit, "scale_length", text="Scale") - if wide_ui: - col = split.column() + col = split.column() col.prop(unit, "use_separate") layout.column().prop(unit, "rotation_units") @@ -86,7 +77,6 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel): layout = self.layout scene = context.scene - wide_ui = context.region.width > narrowui row = layout.row() 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.filepath = "keyingset.py" - if wide_ui: - col = row.column() + col = row.column() col.label(text="Keyframing Settings:") col.prop(ks, "insertkey_needed", text="Needed") col.prop(ks, "insertkey_visual", text="Visual") @@ -128,7 +117,6 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): scene = context.scene ks = scene.active_keying_set - wide_ui = context.region.width > narrowui row = layout.row() row.label(text="Paths:") @@ -158,8 +146,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): if ksp.entire_array is False: col.prop(ksp, "array_index") - if wide_ui: - col = row.column() + col = row.column() col.label(text="F-Curve Grouping:") col.prop(ksp, "grouping") if ksp.grouping == 'NAMED': @@ -182,14 +169,10 @@ class SCENE_PT_physics(SceneButtonsPanel, bpy.types.Panel): layout = self.layout scene = context.scene - wide_ui = context.region.width > narrowui layout.active = scene.use_gravity - if wide_ui: - layout.prop(scene, "gravity", text="") - else: - layout.column().prop(scene, "gravity", text="") + layout.prop(scene, "gravity", text="") class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel): @@ -205,7 +188,6 @@ class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel): layout = self.layout scene = context.scene rd = scene.render - wide_ui = context.region.width > narrowui layout.active = rd.use_simplify @@ -217,8 +199,7 @@ class SCENE_PT_simplify(SceneButtonsPanel, bpy.types.Panel): 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_ao_sss", text="AO and SSS") diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index aeccbc71e46..32c572d849b 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class TEXTURE_MT_specials(bpy.types.Menu): bl_label = "Texture Specials" @@ -112,7 +110,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel): node = context.texture_node space = context.space_data tex = context.texture - wide_ui = context.region.width > narrowui idblock = context_tex_datablock(context) 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.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="") - if wide_ui: - split = layout.split(percentage=0.65) - col = split.column() - else: - col = layout.column() + split = layout.split(percentage=0.65) + col = split.column() if tex_collection: 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: col.template_ID(space, "pin_id") - if wide_ui: - col = split.column() + col = split.column() if not space.pin_id: 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="") else: - if wide_ui: - split.label(text="Type:") - split.prop(tex, "type", text="") - else: - layout.prop(tex, "type", text="") + split.label(text="Type:") + split.prop(tex, "type", text="") 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 tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "use_color_ramp", text="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_blue", text="B") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Adjust:") col.prop(tex, "brightness") col.prop(tex, "contrast") @@ -249,7 +237,6 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): tex = context.texture_slot # textype = context.texture - wide_ui = context.region.width > narrowui if type(idblock) != bpy.types.Brush: split = layout.split(percentage=0.3) @@ -301,11 +288,10 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): col.prop(tex, "from_dupli") elif tex.texture_coordinates == 'OBJECT': col.prop(tex, "from_original") - elif wide_ui: + else: col.label() - if wide_ui: - col = split.column() + col = split.column() row = col.row() row.prop(tex, "x_mapping", text="") row.prop(tex, "y_mapping", text="") @@ -316,10 +302,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, bpy.types.Panel): col = split.column() col.prop(tex, "offset") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.prop(tex, "size") @@ -348,7 +331,6 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): # textype = context.texture tex = context.texture_slot - wide_ui = context.region.width > narrowui def factor_but(layout, active, toggle, factor, name): 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_hardness, "map_hardness", "hardness_factor", "Hardness") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Shading:") factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") 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_reflection, "map_reflection", "reflection_factor", "Reflection") - if wide_ui: - col = split.column() - col.label(text=" ") + col = split.column() + col.label(text=" ") 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_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color") @@ -412,8 +392,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): col = split.column() 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") 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_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_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.prop(tex, "color", text="") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "negate", text="Negative") col.prop(tex, "stencil") @@ -469,15 +446,11 @@ class TEXTURE_PT_clouds(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") 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_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla", text="Nabla") @@ -505,22 +477,15 @@ class TEXTURE_PT_wood(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "noisebasis2", expand=True) - if wide_ui: - layout.prop(tex, "stype", expand=True) - else: - layout.prop(tex, "stype", text="") + layout.prop(tex, "stype", expand=True) col = layout.column() col.active = tex.stype in ('RINGNOISE', 'BANDNOISE') col.label(text="Noise:") col.row().prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() split.active = tex.stype in ('RINGNOISE', 'BANDNOISE') @@ -548,16 +513,12 @@ class TEXTURE_PT_marble(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.prop(tex, "noisebasis2", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") 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_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") col.prop(tex, "nabla") @@ -586,15 +546,13 @@ class TEXTURE_PT_magic(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui split = layout.split() col = split.column() col.prop(tex, "noise_depth", text="Depth") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") @@ -613,12 +571,8 @@ class TEXTURE_PT_blend(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "progression") - else: - layout.prop(tex, "progression", text="") + layout.prop(tex, "progression") sub = layout.row() @@ -641,23 +595,18 @@ class TEXTURE_PT_stucci(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui layout.prop(tex, "stype", expand=True) layout.label(text="Noise:") layout.prop(tex, "noise_type", text="Type", expand=True) - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() col = split.column() col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "turbulence") @@ -710,7 +659,6 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel): tex = context.texture # slot = context.texture_slot - wide_ui = context.region.width > narrowui split = layout.split() @@ -722,10 +670,8 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, bpy.types.Panel): col.separator() col.prop(tex, "flip_axis", text="Flip X/Y Axis") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() + col.prop(tex, "normal_map") row = col.row() row.active = tex.normal_map @@ -756,12 +702,8 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "extension") - else: - layout.prop(tex, "extension", text="") + layout.prop(tex, "extension") 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_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Mirror:") col.prop(tex, "mirror_x", text="X") 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_odd", text="Odd") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "checker_distance", text="Distance") 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_y", text="Y") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Crop Maximum:") col.prop(tex, "crop_max_x", text="X") col.prop(tex, "crop_max_y", text="Y") @@ -841,7 +780,6 @@ class TEXTURE_PT_envmap(TextureTypePanel, bpy.types.Panel): tex = context.texture env = tex.environment_map - wide_ui = context.region.width > narrowui row = layout.row() 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, "depth") - if wide_ui: - col = split.column(align=True) + col = split.column(align=True) col.label(text="Clipping:") col.prop(env, "clip_start", text="Start") @@ -906,12 +843,8 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "musgrave_type") - else: - layout.prop(tex, "musgrave_type", text="") + layout.prop(tex, "musgrave_type") split = layout.split() @@ -920,8 +853,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, bpy.types.Panel): col.prop(tex, "lacunarity") col.prop(tex, "octaves") - if wide_ui: - col = split.column() + col = split.column() if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')): col.prop(tex, "offset") 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:") - if wide_ui: - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() col = split.column() col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -960,7 +888,6 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui split = layout.split() @@ -974,8 +901,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel, bpy.types.Panel): col.prop(tex, "coloring", text="") col.prop(tex, "noise_intensity", text="Intensity") - if wide_ui: - col = split.column() + col = split.column() sub = col.column(align=True) sub.label(text="Feature Weights:") 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.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -1010,14 +935,9 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel): layout = self.layout tex = context.texture - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(tex, "noise_distortion") - layout.prop(tex, "noise_basis", text="Basis") - else: - layout.prop(tex, "noise_distortion", text="") - layout.prop(tex, "noise_basis", text="") + layout.prop(tex, "noise_distortion") + layout.prop(tex, "noise_basis", text="Basis") split = layout.split() @@ -1025,8 +945,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, bpy.types.Panel): col.prop(tex, "distortion", text="Distortion") col.prop(tex, "noise_size", text="Size") - if wide_ui: - col = split.column() + col = split.column() col.prop(tex, "nabla") @@ -1084,12 +1003,8 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel): tex = context.texture pd = tex.pointdensity - wide_ui = context.region.width > narrowui - if wide_ui: - layout.prop(pd, "point_source", expand=True) - else: - layout.prop(pd, "point_source", text="") + layout.prop(pd, "point_source", expand=True) split = layout.split() @@ -1120,8 +1035,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, bpy.types.Panel): if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): layout.template_color_ramp(pd, "color_ramp", expand=True) - if wide_ui: - col = split.column() + col = split.column() col.label() col.prop(pd, "radius") col.label(text="Falloff:") @@ -1154,7 +1068,6 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel): tex = context.texture pd = tex.pointdensity layout.active = pd.turbulence - wide_ui = context.region.width > narrowui split = layout.split() @@ -1164,9 +1077,8 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, bpy.types.Panel): col.label(text="Noise Basis:") col.prop(pd, "noise_basis", text="") - if wide_ui: - col = split.column() - col.label() + col = split.column() + col.label() col.prop(pd, "turbulence_size") col.prop(pd, "turbulence_depth") col.prop(pd, "turbulence_strength") diff --git a/release/scripts/ui/properties_world.py b/release/scripts/ui/properties_world.py index 5179fc5f0d2..9825ba94d17 100644 --- a/release/scripts/ui/properties_world.py +++ b/release/scripts/ui/properties_world.py @@ -20,8 +20,6 @@ import bpy from rna_prop_ui import PropertyPanel -narrowui = bpy.context.user_preferences.view.properties_width_check - class WorldButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -59,17 +57,12 @@ class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel): scene = context.scene world = context.world space = context.space_data - wide_ui = context.region.width > narrowui - - if wide_ui: - split = layout.split(percentage=0.65) - if scene: - split.template_ID(scene, "world", new="world.new") - elif world: - split.template_ID(space, "pin_id") - else: - layout.template_ID(scene, "world", new="world.new") + split = layout.split(percentage=0.65) + if scene: + split.template_ID(scene, "world", new="world.new") + elif world: + split.template_ID(space, "pin_id") 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): layout = self.layout - wide_ui = context.region.width > narrowui world = context.world - if wide_ui: - row = layout.row() - row.prop(world, "paper_sky") - row.prop(world, "blend_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.prop(world, "paper_sky") + row.prop(world, "blend_sky") + row.prop(world, "real_sky") row = layout.row() row.column().prop(world, "horizon_color") @@ -117,7 +103,6 @@ class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel): def draw(self, context): layout = self.layout - wide_ui = context.region.width > narrowui world = context.world 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, "start") - if wide_ui: - col = split.column() + col = split.column() col.prop(world.mist, "depth") col.prop(world.mist, "height") @@ -148,7 +132,6 @@ class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel): def draw(self, context): layout = self.layout - wide_ui = context.region.width > narrowui world = context.world 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, "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, "average_separation", text="Separation") diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py index eafe2d183f6..2bd394809d5 100644 --- a/release/scripts/ui/space_image.py +++ b/release/scripts/ui/space_image.py @@ -19,8 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - class IMAGE_MT_view(bpy.types.Menu): bl_label = "View" @@ -366,7 +364,6 @@ class IMAGE_PT_game_properties(bpy.types.Panel): sima = context.space_data ima = sima.image - wide_ui = context.region.width > narrowui 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_y", text="Y") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Clamp:") col.prop(ima, "clamp_x", text="X") col.prop(ima, "clamp_y", text="Y") @@ -509,7 +505,6 @@ class IMAGE_PT_view_properties(bpy.types.Panel): ima = sima.image show_uvedit = sima.show_uvedit uvedit = sima.uv_editor - wide_ui = context.region.width > narrowui split = layout.split() @@ -517,8 +512,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel): if ima: col.prop(ima, "display_aspect", text="Aspect Ratio") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Coordinates:") col.prop(sima, "draw_repeated", text="Repeat") if show_uvedit: @@ -536,10 +530,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel): col = layout.column() col.label(text="UVs:") row = col.row() - if wide_ui: - row.prop(uvedit, "edge_draw_type", expand=True) - else: - row.prop(uvedit, "edge_draw_type", text="") + row.prop(uvedit, "edge_draw_type", expand=True) split = layout.split() col = split.column() @@ -548,8 +539,7 @@ class IMAGE_PT_view_properties(bpy.types.Panel): #col.prop(uvedit, "draw_edges") #col.prop(uvedit, "draw_faces") - if wide_ui: - col = split.column() + col = split.column() col.prop(uvedit, "draw_stretch", text="Stretch") sub = col.column() sub.active = uvedit.draw_stretch diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 8fa8b56f759..6f521ede722 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -176,12 +176,6 @@ class USERPREF_PT_interface(bpy.types.Panel): sub.prop(view, "mini_axis_brightness", text="Brightness") col.separator() - col.separator() - col.separator() - - col.label(text="Properties Window:") - col.prop(view, "properties_width_check") - row.separator() row.separator() diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 24fb86066a7..af435f1da77 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check class View3DPanel(): bl_space_type = 'VIEW_3D' @@ -742,7 +741,6 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel): if context.sculpt_object: #XXX duplicated from properties_texture.py - wide_ui = context.region.width > narrowui col.separator() @@ -787,10 +785,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel): col = split.column() col.prop(tex_slot, "offset") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.prop(tex_slot, "size") @@ -991,7 +986,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel): def draw(self, context): layout = self.layout - wide_ui = context.region.width > narrowui tool_settings = context.tool_settings 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_strength", text="Strength") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.label(text="Lock:") 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) def draw(self, context): - wide_ui = context.region.width > narrowui 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_z", text="Z") - if wide_ui: - col = split.column() - else: - col.separator() + col = split.column() col.prop(sculpt, "radial_symm", text="Radial") diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 4b02e4b1e65..84621e7c6e2 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1511,11 +1511,6 @@ void init_userdef_do_versions(void) if (U.v2d_min_gridsize == 0) { 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 */ // XXX space_set_commmandline_options(); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index ff27d40ff9b..7c8a24e9e8c 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -364,7 +364,7 @@ typedef struct UserDef { short scrcastfps; /* frame rate for screencast to be played back */ 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 verseuser[160]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9faaf53f93a..356d55b8120 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -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_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"); - - /* 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) |