[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2279] trunk/py/scripts/addons: Addon UI Cleanup, Part 2

Thomas Dinges blender at dingto.org
Sat Aug 27 15:38:54 CEST 2011


Revision: 2279
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2279
Author:   dingto
Date:     2011-08-27 13:38:53 +0000 (Sat, 27 Aug 2011)
Log Message:
-----------
Addon UI Cleanup, Part 2
* You only have to do layout.prop if you want 1 property, no need for row then!
* Use col, row, sub as variable names, not colsub, rowsub, row2 etc please.
* Povray Addon: Still used a lot of splits, you need no split when you only have 1 column! 

Modified Paths:
--------------
    trunk/py/scripts/addons/development_api_navigator.py
    trunk/py/scripts/addons/io_import_gimp_image_to_scene.py
    trunk/py/scripts/addons/io_import_images_as_planes.py
    trunk/py/scripts/addons/io_import_scene_mhx.py
    trunk/py/scripts/addons/light_field_tools/light_field_tools.py
    trunk/py/scripts/addons/mesh_bsurfaces.py
    trunk/py/scripts/addons/mesh_inset/__init__.py
    trunk/py/scripts/addons/mocap/__init__.py
    trunk/py/scripts/addons/object_cloud_gen.py
    trunk/py/scripts/addons/render_povray/ui.py
    trunk/py/scripts/addons/rigify/ui.py
    trunk/py/scripts/addons/space_view3d_3d_navigation.py
    trunk/py/scripts/addons/space_view3d_math_vis/__init__.py
    trunk/py/scripts/addons/system_demo_mode/__init__.py
    trunk/py/scripts/addons/texture_paint_layer_manager.py

Modified: trunk/py/scripts/addons/development_api_navigator.py
===================================================================
--- trunk/py/scripts/addons/development_api_navigator.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/development_api_navigator.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -627,9 +627,10 @@
 
         ###### layout ######
         layout = self.layout
-        col = layout.column()
-        layout.label(text='Tree Structure')
+
+        layout.label(text="Tree Structure:")
         col = layout.column(align=True)
+        
         col.prop(bpy.context.window_manager.api_nav_props, 'path', text='')
         row = col.row()
         row.operator("api_navigator.parent", text="Parent", icon="BACK")

Modified: trunk/py/scripts/addons/io_import_gimp_image_to_scene.py
===================================================================
--- trunk/py/scripts/addons/io_import_gimp_image_to_scene.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/io_import_gimp_image_to_scene.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -606,6 +606,7 @@
     
     def draw(self, context):
         layout = self.layout
+        
         box = layout.box()
         box.label('3D Layers:', icon='SORTSIZE')
         box.prop(self, 'SetCamera', icon='OUTLINER_DATA_CAMERA')
@@ -616,6 +617,7 @@
         box.prop(self, 'ShadelessMats', icon='SOLID')
         box.prop(self, 'LayerOffset')
         box.prop(self, 'LayerScale')
+        
         box = layout.box()
         box.label('Compositing:', icon='RENDERLAYERS')
         box.prop(self, 'SetupCompo', icon='NODETREE')

Modified: trunk/py/scripts/addons/io_import_images_as_planes.py
===================================================================
--- trunk/py/scripts/addons/io_import_images_as_planes.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/io_import_images_as_planes.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -314,18 +314,21 @@
     ## DRAW ##
     def draw(self, context):
         layout = self.layout
+        
         box = layout.box()
         box.label('Import Options:', icon='FILTER')
         box.prop(self, 'all_in_directory')
         box.prop(self, 'extension', icon='FILE_IMAGE')
         box.prop(self, 'align')
         box.prop(self, 'align_offset')
+        
         box = layout.box()
         box.label('Material mappings:', icon='MATERIAL')
         box.prop(self, 'use_shadeless')
         box.prop(self, 'use_transparency')
         box.prop(self, 'use_premultiply')
         box.prop(self, 'transparency_method', expand=True)
+        
         box = layout.box()
         box.label('Plane dimensions:', icon='ARROW_LEFTRIGHT')
         box.prop(self, 'use_dimension')

Modified: trunk/py/scripts/addons/io_import_scene_mhx.py
===================================================================
--- trunk/py/scripts/addons/io_import_scene_mhx.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/io_import_scene_mhx.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -2907,8 +2907,7 @@
         return False
 
     def draw(self, context):
-        layout = self.layout
-        layout.operator("mhxrig.rigify_mhx")
+        self.layout.operator("mhxrig.rigify_mhx")
         return
 
 ###################################################################################

Modified: trunk/py/scripts/addons/light_field_tools/light_field_tools.py
===================================================================
--- trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -401,12 +401,11 @@
     bl_label = "Light Field Tools"
 
     def draw(self, context):
+        layout = self.layout
+        
         scene = context.scene
 
-        layout = self.layout
-        layout.row()  # XXX, is this needed?
         col = layout.column()
-
         col.prop(scene.lightfield, "row_length")
         col.prop(scene.lightfield, "angle")
 
@@ -416,18 +415,16 @@
         col.prop(scene.lightfield, "animate_camera")
         col.prop(scene.lightfield, "do_projection")
 
-        sub = layout.row()
-        sub.enabled = scene.lightfield.do_projection
-        subcol = sub.column(align=True)
-        subcol.prop(scene.lightfield, "texture_path")
-        subcol.prop(scene.lightfield, "light_intensity")
-        subcol.prop(scene.lightfield, "spot_blend")
+        col = layout.column(align=True)
+        col.enabled = scene.lightfield.do_projection
+        col.prop(scene.lightfield, "texture_path")
+        col.prop(scene.lightfield, "light_intensity")
+        col.prop(scene.lightfield, "spot_blend")
 
         # create a basemesh
-        sub = layout.row()
-        subcol = sub.column(align=True)
-        subcol.operator("object.create_lightfield_basemesh", "Create Base Grid")
-        subcol.prop(scene.lightfield, "spacing")
+        col = layout.column(align=True)
+        col.operator("object.create_lightfield_basemesh", "Create Base Grid")
+        col.prop(scene.lightfield, "spacing")
 
         layout.operator("object.create_lightfield_rig", "Create Rig")
 

Modified: trunk/py/scripts/addons/mesh_bsurfaces.py
===================================================================
--- trunk/py/scripts/addons/mesh_bsurfaces.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/mesh_bsurfaces.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -53,22 +53,16 @@
         layout = self.layout
         
         scn = context.scene
-        ob = context.object
         
         col = layout.column(align=True)
-        row = layout.row()
-        row.separator()
         col.operator("gpencil.surfsk_add_surface", text="Add Surface")
         col.prop(scn, "SURFSK_edges_U")
         col.prop(scn, "SURFSK_edges_V")
-        row.separator()
-        col.prop(scn, "SURFSK_keep_strokes")
-        col.separator()
-        row.separator()
-        col.operator("gpencil.surfsk_strokes_to_curves", text="Strokes to curves")
         
+        layout.prop(scn, "SURFSK_keep_strokes")
+        layout.operator("gpencil.surfsk_strokes_to_curves", text="Strokes to curves")
+        
 
-
 class GPENCIL_OT_SURFSK_add_surface(bpy.types.Operator):
     bl_idname = "gpencil.surfsk_add_surface"
     bl_label = "Bsurfaces add surface"

Modified: trunk/py/scripts/addons/mesh_inset/__init__.py
===================================================================
--- trunk/py/scripts/addons/mesh_inset/__init__.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/mesh_inset/__init__.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -90,7 +90,7 @@
     def draw(self, context):
         layout = self.layout
         box = layout.box()
-        box.label("Inset Options")
+        box.label("Inset Options:")
         box.prop(self, "scale")
         box.prop(self, "inset_amount")
         box.prop(self, "inset_height")

Modified: trunk/py/scripts/addons/mocap/__init__.py
===================================================================
--- trunk/py/scripts/addons/mocap/__init__.py	2011-08-27 12:51:34 UTC (rev 2278)
+++ trunk/py/scripts/addons/mocap/__init__.py	2011-08-27 13:38:53 UTC (rev 2279)
@@ -257,24 +257,28 @@
     bl_context = "object"
 
     def draw(self, context):
-        self.layout.label("Preprocessing")
-        row = self.layout.row(align=True)
-        row.alignment = 'EXPAND'
+        layout = self.layout()
+        
+        layout.label("Preprocessing:")
+        
+        row = layout.row(align=True)
         row.operator("mocap.denoise", text='Clean noise')
         row.operator("mocap.rotate_fix", text='Fix BVH Axis Orientation')
         row.operator("mocap.scale_fix", text='Auto scale Performer')
-        row2 = self.layout.row(align=True)
-        row2.operator("mocap.looper", text='Loop animation')
-        row2.operator("mocap.limitdof", text='Constrain Rig')
-        row2.operator("mocap.removelimitdof", text='Unconstrain Rig')
-        self.layout.label("Retargeting")
+        
+        row = layout.row(align=True)
+        row.operator("mocap.looper", text='Loop animation')
+        row.operator("mocap.limitdof", text='Constrain Rig')
+        row.operator("mocap.removelimitdof", text='Unconstrain Rig')
+        
+        layout.label("Retargeting:")
         enduser_obj = bpy.context.active_object
         performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj]
         if enduser_obj is None or len(performer_obj) != 1:
-            self.layout.label("Select performer rig and target rig (as active)")
+            layout.label("Select performer rig and target rig (as active)")
         else:
-            self.layout.operator("mocap.guessmapping", text="Guess Hiearchy Mapping")
-            labelRow = self.layout.row(align=True)
+            layout.operator("mocap.guessmapping", text="Guess Hiearchy Mapping")
+            labelRow = layout.row(align=True)
             labelRow.label("Performer Rig")
             labelRow.label("End user Rig")
             performer_obj = performer_obj[0]
@@ -283,7 +287,7 @@
                     perf = performer_obj.data
                     enduser_arm = enduser_obj.data
                     perf_pose_bones = enduser_obj.pose.bones
-                    MappingRow = self.layout.row(align=True)
+                    MappingRow = layout.row(align=True)
                     footCol = MappingRow.column(align=True)
                     nameCol = MappingRow.column(align=True)
                     nameCol.scale_x = 2
@@ -316,7 +320,7 @@
                             twistCol.label(" ")
                             IKCol.label(" ")
                             IKLabel.label(" ")
-                    mapRow = self.layout.row()
+                    mapRow = layout.row()
                     mapRow.operator("mocap.savemapping", text='Save mapping')
                     mapRow.operator("mocap.loadmapping", text='Load mapping')
                     extraSettings = self.layout.box()
@@ -324,7 +328,7 @@
                         extraSettings.prop(data=performer_obj.animation_data.action, property='name', text='Action Name')
                     extraSettings.prop(enduser_arm, "frameStep")
                     extraSettings.prop(enduser_arm, "advancedRetarget", text='Advanced Retarget')
-                    self.layout.operator("mocap.retarget", text='RETARGET!')

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list