patch [#20673] Fixed descriptions in Torus mesh controls, and added some requested...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jan 2010 22:45:56 +0000 (22:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 14 Jan 2010 22:45:56 +0000 (22:45 +0000)
from Jaevixa McNomera (jaevixa)

release/scripts/op/add_mesh_torus.py

index 865b1d57daff740fafe800284e28972e329b96b0..ccc9a4ba7761a3ce5e57a69a88739c567642fe6f 100644 (file)
@@ -93,9 +93,24 @@ class AddTorus(bpy.types.Operator):
     minor_segments = IntProperty(name="Minor Segments",
             description="Number of segments for the minor ring of the torus",
             default=16, min=3, max=256)
+    use_abso = BoolProperty(name="Use Int+Ext Controls",
+            description="Use the Int / Ext controls for torus dimensions", default=False)
+    abso_major_rad = FloatProperty(name="Exterior Radius",
+            description="Total Exterior Radius of the torus",
+            default=1.0, min=0.01, max=100.0)
+    abso_minor_rad = FloatProperty(name="Inside Radius",
+            description="Total Interior Radius of the torus",
+            default=0.5, min=0.01, max=100.0)
 
     def execute(self, context):
 
+        #deleting between THESE lines makes it re-appear in blender
+        if self.properties.use_abso == True:
+            extra_helper = (self.properties.abso_major_rad - self.properties.abso_minor_rad) * 0.5
+            self.properties.major_radius = self.properties.abso_minor_rad + extra_helper
+            self.properties.minor_radius = extra_helper
+        #deleting between THESE lines makes it re-appear in blender
+
         verts_loc, faces = add_torus(self.properties.major_radius,
                                     self.properties.minor_radius,
                                     self.properties.major_segments,