[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1035] trunk/py/scripts/addons: minor changes, avoid lookups on bpy.types.Scene for many settings

Campbell Barton ideasman42 at gmail.com
Mon Sep 13 06:44:14 CEST 2010


Revision: 1035
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1035
Author:   campbellbarton
Date:     2010-09-13 06:44:13 +0200 (Mon, 13 Sep 2010)

Log Message:
-----------
minor changes, avoid lookups on bpy.types.Scene for many settings

Modified Paths:
--------------
    trunk/py/scripts/addons/add_mesh_BoltFactory/original_script_add_mesh_bolt.py
    trunk/py/scripts/addons/object_cloud_gen.py

Modified: trunk/py/scripts/addons/add_mesh_BoltFactory/original_script_add_mesh_bolt.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_BoltFactory/original_script_add_mesh_bolt.py	2010-09-13 04:23:17 UTC (rev 1034)
+++ trunk/py/scripts/addons/add_mesh_BoltFactory/original_script_add_mesh_bolt.py	2010-09-13 04:44:13 UTC (rev 1035)
@@ -2193,16 +2193,17 @@
 
 
 def Create_Propertys():
+    Scene = bpy.types.Scene
     #Model Types
     Model_Type_List = [('bf_Model_Bolt','BOLT','Bolt Model'),('bf_Model_Nut','NUT','Nut Model')]
-    bpy.types.Scene.bf_Model_Type = EnumProperty(
+    Scene.bf_Model_Type = EnumProperty(
             name='Model',
             description='Choose the type off model you would like',
             items = Model_Type_List, default = 'bf_Model_Bolt')
 
     #Head Types
     Model_Type_List = [('bf_Head_Hex','HEX','Hex Head'),('bf_Head_Cap','CAP','Cap Head'),('bf_Head_Dome','DOME','Dome Head'),('bf_Head_Pan','PAN','Pan Head')]
-    bpy.types.Scene.bf_Head_Type = EnumProperty(
+    Scene.bf_Head_Type = EnumProperty(
             name='Head',
             description='Choose the type off Head you would like',
             items = Model_Type_List, default = 'bf_Head_Hex')
@@ -2210,7 +2211,7 @@
     
         #Bit Types
     Bit_Type_List = [('bf_Bit_None','NONE','No Bit Type'),('bf_Bit_Allen','ALLEN','Allen Bit Type'),('bf_Bit_Philips','PHILLIPS','Phillips Bit Type')]
-    bpy.types.Scene.bf_Bit_Type = EnumProperty(
+    Scene.bf_Bit_Type = EnumProperty(
             name='Bit Type',
             description='Choose the type of bit to you would like',
             items = Bit_Type_List, default = 'bf_Bit_None')
@@ -2218,135 +2219,135 @@
 
     #Nut Types
     Nut_Type_List = [('bf_Nut_Hex','HEX','Hex Nut'),('bf_Nut_Lock','LOCK','Lock Nut')]
-    bpy.types.Scene.bf_Nut_Type = EnumProperty(
+    Scene.bf_Nut_Type = EnumProperty(
             name='Nut Type',
             description='Choose the type of nut you would like',
             items = Nut_Type_List, default = 'bf_Nut_Hex')
     
     
     Preset_List = [('bf_Preset_M3','M3','M3'),('bf_Preset_M4','M4','M4'),('bf_Preset_M5','M5','M5'),('bf_Preset_M6','M6','M6'),('bf_Preset_M8','M8','M8'),('bf_Preset_M10','M10','M10'),('bf_Preset_M12','M12','M12')]
-    bpy.types.Scene.bf_Preset_Menu = EnumProperty(
+    Scene.bf_Preset_Menu = EnumProperty(
             name='Presets',
             description='Choose a screw type and Click Apply',
             items = Preset_List, default = 'bf_Preset_M3')
 
     #Shank Types    
-    bpy.types.Scene.bf_Shank_Length = FloatProperty(
+    Scene.bf_Shank_Length = FloatProperty(
             name='Shank Length',
             min = 0,max = MAX_INPUT_NUMBER, 
             description='Length of the unthreaded shank'
             )
     
-    bpy.types.Scene.bf_Shank_Dia = FloatProperty(
+    Scene.bf_Shank_Dia = FloatProperty(
             name='Shank Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Diameter of the shank'
             )
 
-    bpy.types.Scene.bf_Phillips_Bit_Depth = FloatProperty(
+    Scene.bf_Phillips_Bit_Depth = FloatProperty(
             name='Bit Depth',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Depth of the Phillips Bit'
             )
 
-    bpy.types.Scene.bf_Philips_Bit_Dia = FloatProperty(
+    Scene.bf_Philips_Bit_Dia = FloatProperty(
             name='Bit Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Diameter of the Philips Bit'
             )
     
-    bpy.types.Scene.bf_Allen_Bit_Depth = FloatProperty(
+    Scene.bf_Allen_Bit_Depth = FloatProperty(
             name='Bit Depth',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Depth of the Allen Bit'
             )
 
-    bpy.types.Scene.bf_Allen_Bit_Flat_Distance = FloatProperty(
+    Scene.bf_Allen_Bit_Flat_Distance = FloatProperty(
             name='Flat Dist',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Flat Distance of the Allen Bit'
             )
     
-    bpy.types.Scene.bf_Hex_Head_Height = FloatProperty(
+    Scene.bf_Hex_Head_Height = FloatProperty(
             name='Head Height',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Height of the Hex Head'
             )
 
-    bpy.types.Scene.bf_Hex_Head_Flat_Distance = FloatProperty(
+    Scene.bf_Hex_Head_Flat_Distance = FloatProperty(
             name='Flat Dist',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Flat Distance of the Hex Head'
             )
 
 
-    bpy.types.Scene.bf_Cap_Head_Dia = FloatProperty(
+    Scene.bf_Cap_Head_Dia = FloatProperty(
             name='Head Height',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Diameter of the Cap Head'
             )
 
-    bpy.types.Scene.bf_Cap_Head_Height = FloatProperty(
+    Scene.bf_Cap_Head_Height = FloatProperty(
             name='Head Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Height of the Cap Head'
             )
 
-    bpy.types.Scene.bf_Dome_Head_Dia = FloatProperty(
+    Scene.bf_Dome_Head_Dia = FloatProperty(
             name='Dome Head Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Length of the unthreaded shank'
             )
 
-    bpy.types.Scene.bf_Pan_Head_Dia = FloatProperty(
+    Scene.bf_Pan_Head_Dia = FloatProperty(
             name='Pan Head Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Diameter of the Pan Head'
             )
 
-    bpy.types.Scene.bf_Thread_Length = FloatProperty(
+    Scene.bf_Thread_Length = FloatProperty(
             name='Thread Length',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Length of the Thread'
             )
 
-    bpy.types.Scene.bf_Major_Dia = FloatProperty(
+    Scene.bf_Major_Dia = FloatProperty(
             name='Major Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Outside diameter of the Thread'
             )
 
-    bpy.types.Scene.bf_Minor_Dia = FloatProperty(
+    Scene.bf_Minor_Dia = FloatProperty(
             name='Minor Dia',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Inside diameter of the Thread'
             )
 
-    bpy.types.Scene.bf_Pitch = FloatProperty(
+    Scene.bf_Pitch = FloatProperty(
             name='Pitch',
             min = 0.1,max = 7.0,
             description='Pitch if the thread'
             )
     
-    bpy.types.Scene.bf_Crest_Percent = IntProperty(
+    Scene.bf_Crest_Percent = IntProperty(
             name='Crest Percent',
             min = 1,max = 90,
             description='Percent of the pitch that makes up the Crest'
             )
 
-    bpy.types.Scene.bf_Root_Percent = IntProperty(
+    Scene.bf_Root_Percent = IntProperty(
             name='Root Percent',
             min = 1,max = 90,
             description='Percent of the pitch that makes up the Root'
             )
 
-    bpy.types.Scene.bf_Hex_Nut_Height = FloatProperty(
+    Scene.bf_Hex_Nut_Height = FloatProperty(
             name='Hex Nut Height',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Height of the Hex Nut'
             )
 
-    bpy.types.Scene.bf_Hex_Nut_Flat_Distance = FloatProperty(
+    Scene.bf_Hex_Nut_Flat_Distance = FloatProperty(
             name='Hex Nut Flat Dist',
             min = 0,max = MAX_INPUT_NUMBER,
             description='Flat distance of the Hex Nut'

Modified: trunk/py/scripts/addons/object_cloud_gen.py
===================================================================
--- trunk/py/scripts/addons/object_cloud_gen.py	2010-09-13 04:23:17 UTC (rev 1034)
+++ trunk/py/scripts/addons/object_cloud_gen.py	2010-09-13 04:44:13 UTC (rev 1035)
@@ -312,8 +312,9 @@
 bpy.types.Scene.cloud_type = EnumProperty(
     name="Type",
     description="Select the type of cloud to create with material settings",
-    items = cloudTypes, default = '0')
+    items=cloudTypes, default='0')
 
+
 class GenerateCloud(bpy.types.Operator):
     bl_idname = "cloud.generate_cloud"
     bl_label = "Generate Cloud"




More information about the Bf-extensions-cvs mailing list