[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55787] trunk/blender/release/scripts/ startup/bl_ui: code cleanup: py ui

Campbell Barton ideasman42 at gmail.com
Thu Apr 4 19:01:52 CEST 2013


Revision: 55787
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55787
Author:   campbellbarton
Date:     2013-04-04 17:01:51 +0000 (Thu, 04 Apr 2013)
Log Message:
-----------
code cleanup: py ui

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
    trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py
    trunk/blender/release/scripts/startup/bl_ui/space_info.py
    trunk/blender/release/scripts/startup/bl_ui/space_time.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py	2013-04-04 16:23:00 UTC (rev 55786)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py	2013-04-04 17:01:51 UTC (rev 55787)
@@ -117,7 +117,7 @@
 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

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py	2013-04-04 16:23:00 UTC (rev 55786)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_physics_common.py	2013-04-04 17:01:51 UTC (rev 55787)
@@ -39,7 +39,7 @@
     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 @@
     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

Modified: trunk/blender/release/scripts/startup/bl_ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_info.py	2013-04-04 16:23:00 UTC (rev 55786)
+++ trunk/blender/release/scripts/startup/bl_ui/space_info.py	2013-04-04 17:01:51 UTC (rev 55787)
@@ -304,7 +304,7 @@
         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:

Modified: trunk/blender/release/scripts/startup/bl_ui/space_time.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_time.py	2013-04-04 16:23:00 UTC (rev 55786)
+++ trunk/blender/release/scripts/startup/bl_ui/space_time.py	2013-04-04 17:01:51 UTC (rev 55787)
@@ -214,7 +214,7 @@
     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:

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-04-04 16:23:00 UTC (rev 55786)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2013-04-04 17:01:51 UTC (rev 55787)
@@ -1113,7 +1113,7 @@
     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:




More information about the Bf-blender-cvs mailing list