diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-04 21:01:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-04 21:01:51 +0400 |
commit | e8c272422a44a25a0324eeade4154fe349f401fe (patch) | |
tree | 07a3d58b0b3074a608d74891ab03b8837d975440 /release/scripts/startup/bl_ui | |
parent | 7338dea2524b2ed0c4049f6043ae2246605a9438 (diff) |
code cleanup: py ui
Diffstat (limited to 'release/scripts/startup/bl_ui')
5 files changed, 12 insertions, 13 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 391874ea3dc..ce7335d2975 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -117,7 +117,7 @@ def brush_texture_settings(layout, brush, sculpt): def brush_mask_texture_settings(layout, brush): mask_tex_slot = brush.mask_texture_slot - if(brush.mask_texture): + if brush.mask_texture: layout.label(text="Mask Mapping:") col = layout.column() col.active = brush.brush_capabilities.has_texture_angle diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index b02a53302e7..3d7fe59ff77 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -39,7 +39,7 @@ def physics_add(self, layout, md, name, type, typeicon, toggles): if md: sub.context_pointer_set("modifier", md) sub.operator("object.modifier_remove", text=name, text_ctxt=i18n_contexts.default, icon='X') - if(toggles): + if toggles: sub.prop(md, "show_render", text="") sub.prop(md, "show_viewport", text="") else: @@ -59,40 +59,39 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel): bl_options = {'HIDE_HEADER'} def draw(self, context): - ob = context.object + obj = context.object layout = self.layout layout.label("Enable physics for:") split = layout.split() col = split.column() - if(context.object.field.type == 'NONE'): + if obj.field.type == 'NONE': col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE') else: col.operator("object.forcefield_toggle", text="Force Field", icon='X') - if(ob.type == 'MESH'): + if obj.type == 'MESH': physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True) col = split.column() - if(ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE'): + if obj.type in {'MESH', 'LATTICE', 'CURVE'}: physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True) - if(ob.type == 'MESH'): + if obj.type == 'MESH': physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True) physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True) - if(ob.type == 'MESH'): - physics_add_special(self, col, ob.rigid_body, "Rigid Body", + physics_add_special(self, col, obj.rigid_body, "Rigid Body", "rigidbody.object_add", "rigidbody.object_remove", 'MESH_ICOSPHERE') # XXX: need dedicated icon # all types of objects can have rigid body constraint - physics_add_special(self, col, ob.rigid_body_constraint, "Rigid Body Constraint", + physics_add_special(self, col, obj.rigid_body_constraint, "Rigid Body Constraint", "rigidbody.constraint_add", "rigidbody.constraint_remove", 'CONSTRAINT') # RB_TODO needs better icon diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index eedfe3587b1..4ea366e3541 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -304,7 +304,7 @@ class INFO_MT_add(Menu): layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY') layout.separator() - if(len(bpy.data.groups) > 10): + if len(bpy.data.groups) > 10: layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY') else: diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 6af9f377237..becdc792230 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -214,7 +214,7 @@ def marker_menu_generic(layout): layout.operator("marker.add", "Add Marker") layout.operator("marker.duplicate", text="Duplicate Marker") - if(len(bpy.data.scenes) > 10): + if len(bpy.data.scenes) > 10: layout.operator_context = 'INVOKE_DEFAULT' layout.operator("marker.make_links_scene", text="Duplicate Marker to Scene...", icon='OUTLINER_OB_EMPTY') else: diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a82d9221166..d3350a77ba7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1113,7 +1113,7 @@ class VIEW3D_MT_make_links(Menu): def draw(self, context): layout = self.layout operator_context_default = layout.operator_context - if(len(bpy.data.scenes) > 10): + if len(bpy.data.scenes) > 10: layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY') else: |