[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1078] trunk/py/scripts/addons: use the operator rather then its properties for drawing the UI, now its supported in the api.

Campbell Barton ideasman42 at gmail.com
Fri Sep 24 05:50:13 CEST 2010


Revision: 1078
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1078
Author:   campbellbarton
Date:     2010-09-24 05:50:13 +0200 (Fri, 24 Sep 2010)

Log Message:
-----------
use the operator rather then its properties for drawing the UI, now its supported in the api.

Modified Paths:
--------------
    trunk/py/scripts/addons/add_curve_aceous_galore.py
    trunk/py/scripts/addons/add_curve_torus_knots.py
    trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py
    trunk/py/scripts/addons/add_mesh_ant_landscape.py
    trunk/py/scripts/addons/add_mesh_gears.py
    trunk/py/scripts/addons/curve_simplify.py
    trunk/py/scripts/addons/io_import_images_as_planes.py
    trunk/py/scripts/addons/space_view3d_copy_attributes.py

Modified: trunk/py/scripts/addons/add_curve_aceous_galore.py
===================================================================
--- trunk/py/scripts/addons/add_curve_aceous_galore.py	2010-09-22 08:16:09 UTC (rev 1077)
+++ trunk/py/scripts/addons/add_curve_aceous_galore.py	2010-09-24 03:50:13 UTC (rev 1078)
@@ -972,94 +972,94 @@
 
         # general options        
         col = layout.column()
-        col.prop(self.properties, 'GalloreType')
+        col.prop(self, 'GalloreType')
         col.label(text=self.GalloreType+" Options")
 
         # options per GalloreType
         box = layout.box()
         if self.GalloreType == 'Profile':
-            box.prop(self.properties, 'ProfileCurveType')
-            box.prop(self.properties, 'ProfileCurvevar1')
-            box.prop(self.properties, 'ProfileCurvevar2')
+            box.prop(self, 'ProfileCurveType')
+            box.prop(self, 'ProfileCurvevar1')
+            box.prop(self, 'ProfileCurvevar2')
         if self.GalloreType == 'Miscellaneous':
-            box.prop(self.properties, 'MiscCurveType')
-            box.prop(self.properties, 'MiscCurvevar1')
-            box.prop(self.properties, 'MiscCurvevar2')
-            #box.prop(self.properties, 'MiscCurvevar3') # doesn't seem to do anything
+            box.prop(self, 'MiscCurveType')
+            box.prop(self, 'MiscCurvevar1')
+            box.prop(self, 'MiscCurvevar2')
+            #box.prop(self, 'MiscCurvevar3') # doesn't seem to do anything
         if self.GalloreType == 'Flower':
-            box.prop(self.properties, 'petals')
-            box.prop(self.properties, 'petalWidth')
-            box.prop(self.properties, 'innerRadius')
-            box.prop(self.properties, 'outerRadius')
+            box.prop(self, 'petals')
+            box.prop(self, 'petalWidth')
+            box.prop(self, 'innerRadius')
+            box.prop(self, 'outerRadius')
         if self.GalloreType == 'Star':
-            box.prop(self.properties, 'starPoints')
-            box.prop(self.properties, 'starTwist')
-            box.prop(self.properties, 'innerRadius')
-            box.prop(self.properties, 'outerRadius')
+            box.prop(self, 'starPoints')
+            box.prop(self, 'starTwist')
+            box.prop(self, 'innerRadius')
+            box.prop(self, 'outerRadius')
         if self.GalloreType == 'Arc':
-            box.prop(self.properties, 'arcSides')
-            box.prop(self.properties, 'arcType') # has only one Type?
-            box.prop(self.properties, 'startAngle')
-            box.prop(self.properties, 'endAngle')
-            box.prop(self.properties, 'innerRadius') # doesn't seem to do anything
-            box.prop(self.properties, 'outerRadius')
+            box.prop(self, 'arcSides')
+            box.prop(self, 'arcType') # has only one Type?
+            box.prop(self, 'startAngle')
+            box.prop(self, 'endAngle')
+            box.prop(self, 'innerRadius') # doesn't seem to do anything
+            box.prop(self, 'outerRadius')
         if self.GalloreType == 'Cogwheel':
-            box.prop(self.properties, 'teeth')
-            box.prop(self.properties, 'bevel')
-            box.prop(self.properties, 'innerRadius')
-            box.prop(self.properties, 'middleRadius')
-            box.prop(self.properties, 'outerRadius')
+            box.prop(self, 'teeth')
+            box.prop(self, 'bevel')
+            box.prop(self, 'innerRadius')
+            box.prop(self, 'middleRadius')
+            box.prop(self, 'outerRadius')
         if self.GalloreType == 'Nsided':
-            box.prop(self.properties, 'Nsides')
-            box.prop(self.properties, 'outerRadius', text='Radius')
+            box.prop(self, 'Nsides')
+            box.prop(self, 'outerRadius', text='Radius')
 
         if self.GalloreType == 'Splat':
-            box.prop(self.properties, 'splatSides')
-            box.prop(self.properties, 'outerRadius')
-            box.prop(self.properties, 'splatScale')
-            box.prop(self.properties, 'seed')
-            box.prop(self.properties, 'basis')
+            box.prop(self, 'splatSides')
+            box.prop(self, 'outerRadius')
+            box.prop(self, 'splatScale')
+            box.prop(self, 'seed')
+            box.prop(self, 'basis')
 
         if self.GalloreType == 'Helix':
-            box.prop(self.properties, 'helixPoints')
-            box.prop(self.properties, 'helixHeight')
-            box.prop(self.properties, 'helixWidth')
-            box.prop(self.properties, 'helixStart')
-            box.prop(self.properties, 'helixEnd')
-            box.prop(self.properties, 'helix_a')
-            box.prop(self.properties, 'helix_b')
+            box.prop(self, 'helixPoints')
+            box.prop(self, 'helixHeight')
+            box.prop(self, 'helixWidth')
+            box.prop(self, 'helixStart')
+            box.prop(self, 'helixEnd')
+            box.prop(self, 'helix_a')
+            box.prop(self, 'helix_b')
         if self.GalloreType == 'Cycloid':
-            box.prop(self.properties, 'cycloPoints')
-            #box.prop(self.properties, 'cycloType') # needs the other types first
-            box.prop(self.properties, 'cycloStart')
-            box.prop(self.properties, 'cycloEnd')
-            box.prop(self.properties, 'cyclo_a')
-            box.prop(self.properties, 'cyclo_b')
-            box.prop(self.properties, 'cyclo_d')
+            box.prop(self, 'cycloPoints')
+            #box.prop(self, 'cycloType') # needs the other types first
+            box.prop(self, 'cycloStart')
+            box.prop(self, 'cycloEnd')
+            box.prop(self, 'cyclo_a')
+            box.prop(self, 'cyclo_b')
+            box.prop(self, 'cyclo_d')
 
         col = layout.column()
         col.label(text="Output Curve Type")
         row = layout.row()
-        row.prop(self.properties, 'outputType', expand=True)
+        row.prop(self, 'outputType', expand=True)
         col = layout.column()
         col.label(text="Curve Options")
 
         # output options
         box = layout.box()
         if self.outputType == 'NURBS':
-            box.row().prop(self.properties, 'shape', expand=True)
-            #box.prop(self.properties, 'use_cyclic_u')
-            #box.prop(self.properties, 'endp_u')
-            box.prop(self.properties, 'order_u')
+            box.row().prop(self, 'shape', expand=True)
+            #box.prop(self, 'use_cyclic_u')
+            #box.prop(self, 'endp_u')
+            box.prop(self, 'order_u')
 
         if self.outputType == 'POLY':
-            box.row().prop(self.properties, 'shape', expand=True)
-            #box.prop(self.properties, 'use_cyclic_u')
+            box.row().prop(self, 'shape', expand=True)
+            #box.prop(self, 'use_cyclic_u')
 
         if self.outputType == 'BEZIER':
-            box.row().prop(self.properties, 'shape', expand=True)
-            box.row().prop(self.properties, 'handleType', expand=True)
-            #box.prop(self.properties, 'use_cyclic_u')
+            box.row().prop(self, 'shape', expand=True)
+            box.row().prop(self, 'handleType', expand=True)
+            #box.prop(self, 'use_cyclic_u')
 
 
     ##### POLL #####

Modified: trunk/py/scripts/addons/add_curve_torus_knots.py
===================================================================
--- trunk/py/scripts/addons/add_curve_torus_knots.py	2010-09-22 08:16:09 UTC (rev 1077)
+++ trunk/py/scripts/addons/add_curve_torus_knots.py	2010-09-24 03:50:13 UTC (rev 1078)
@@ -238,38 +238,37 @@
 
     ##### DRAW #####
     def draw(self, context):
-        props = self.properties
         layout = self.layout
 
         # general options        
         col = layout.column()
-        #col.prop(props, 'KnotType') waits for more knottypes
+        #col.prop(self, 'KnotType') waits for more knottypes
         col.label(text="Torus Knot Parameters")
 
         # Parameters 
         box = layout.box()
-        box.prop(props, 'torus_res')
-        box.prop(props, 'torus_w')
-        box.prop(props, 'torus_h')
-        box.prop(props, 'torus_p')
-        box.prop(props, 'torus_q')
-        box.prop(props, 'options_plus')
-        if props.options_plus:
-            box.prop(props, 'torus_u')
-            box.prop(props, 'torus_v')
-            box.prop(props, 'torus_rounds')
+        box.prop(self, 'torus_res')
+        box.prop(self, 'torus_w')
+        box.prop(self, 'torus_h')
+        box.prop(self, 'torus_p')
+        box.prop(self, 'torus_q')
+        box.prop(self, 'options_plus')
+        if self.options_plus:
+            box.prop(self, 'torus_u')
+            box.prop(self, 'torus_v')
+            box.prop(self, 'torus_rounds')
 
         # surface Options
         col = layout.column()
         col.label(text="Geometry Options")
         box = layout.box()
-        box.prop(props, 'geo_surf')
-        if props.geo_surf:
-            box.prop(props, 'geo_bDepth')
-            box.prop(props, 'geo_bRes')
-            box.prop(props, 'geo_extrude')
-            #box.prop(props, 'geo_width') # not really good
-            box.prop(props, 'geo_res')
+        box.prop(self, 'geo_surf')
+        if self.geo_surf:
+            box.prop(self, 'geo_bDepth')
+            box.prop(self, 'geo_bRes')
+            box.prop(self, 'geo_extrude')
+            #box.prop(self, 'geo_width') # not really good
+            box.prop(self, 'geo_res')
     
     ##### POLL #####
     @classmethod
@@ -281,14 +280,12 @@
         # turn off undo
         undo = bpy.context.user_preferences.edit.use_global_undo
         bpy.context.user_preferences.edit.use_global_undo = False
-
-        props = self.properties
         
         if not self.options_plus:
             self.torus_rounds = self.torus_p
 
         # main function
-        main(context, props, self.align_matrix)
+        main(context, self, self.align_matrix)
         
         # restore pre operator undo state
         bpy.context.user_preferences.edit.use_global_undo = undo

Modified: trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py	2010-09-22 08:16:09 UTC (rev 1077)
+++ trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py	2010-09-24 03:50:13 UTC (rev 1078)
@@ -212,59 +212,59 @@
         col = layout.column()
         
         #ENUMS
-        col.prop(self.properties, 'bf_Model_Type')

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list