[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2185] branches/ivygen/truman_ivy/ add_curve_ivygen.py: - Added the ability to turn leaf generation on/off

Andrew Hale TrumanBlending at gmail.com
Wed Jul 27 11:17:06 CEST 2011


Revision: 2185
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2185
Author:   trumanblending
Date:     2011-07-27 09:17:05 +0000 (Wed, 27 Jul 2011)
Log Message:
-----------
- Added the ability to turn leaf generation on/off

Modified Paths:
--------------
    branches/ivygen/truman_ivy/add_curve_ivygen.py

Modified: branches/ivygen/truman_ivy/add_curve_ivygen.py
===================================================================
--- branches/ivygen/truman_ivy/add_curve_ivygen.py	2011-07-26 05:04:55 UTC (rev 2184)
+++ branches/ivygen/truman_ivy/add_curve_ivygen.py	2011-07-27 09:17:05 UTC (rev 2185)
@@ -526,7 +526,9 @@
                     default=0.0,
                     min=0.0,
                     soft_max=10)
-
+    growLeaves = BoolProperty(name="Grow Leaves",
+                    description="Grow leaves or not.",
+                    default=True)
     updateIvy = BoolProperty(name="Update Ivy", default=False)
 
     @classmethod
@@ -557,7 +559,7 @@
             rand_seed(int(self.randomSeed))
 
             # Make the new ivy
-            IVY = Ivy(**self.as_keywords(ignore=('randomSeed',
+            IVY = Ivy(**self.as_keywords(ignore=('randomSeed', 'growLeaves',
                                       'maxIvyLength', 'maxTime', 'updateIvy')))
 
             # Generate first root and node
@@ -597,11 +599,12 @@
             curveOb = createIvyCurves(IVY)
             print("Curve Generation Complete")
 
-            leafOb = createIvyLeaves(IVY)
-            print("Leaf Generation Complete")
+            if self.growLeaves:
+                leafOb = createIvyLeaves(IVY)
+                print("Leaf Generation Complete")
 
-            # Parent the leave to the curve
-            leafOb.parent = curveOb
+                # Parent the leave to the curve
+                leafOb.parent = curveOb
 
             print("Ivy generated in %0.2f s" % (time.time() - t))
 
@@ -638,6 +641,9 @@
         properties.ivyBranchSize = self.ivyBranchSize
         properties.ivyLeafSize = self.ivyLeafSize
 
+        row = layout.row()
+        row.prop(self, 'growLeaves')
+
         box = layout.box()
         box.label("Generation Settings")
         row = box.row()
@@ -665,17 +671,21 @@
         row = box.row()
         row.prop(self, 'adhesionWeight')
         box = layout.box()
-        box.label("Geometry Settings")
+        box.label("Branch Settings")
         row = box.row()
         row.prop(self, 'branchingProbability')
         row = box.row()
-        row.prop(self, 'leafProbability')
-        row = box.row()
         row.prop(self, 'ivyBranchSize')
-        row = box.row()
-        row.prop(self, 'ivyLeafSize')
 
+        if self.growLeaves:
+            box = layout.box()
+            box.label("Leaf Settings")
+            row = box.row()
+            row.prop(self, 'ivyLeafSize')
+            row = box.row()
+            row.prop(self, 'leafProbability')
 
+
 def menu_func(self, context):
     self.layout.operator(IvyGen.bl_idname, text="Add Ivy", icon='PLUGIN')
 



More information about the Bf-extensions-cvs mailing list