[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2202] trunk/py/scripts/addons/ add_curve_sapling/utils.py: Fixed an issue when levels > 4 were used, causing tree generation failure
Andrew Hale
TrumanBlending at gmail.com
Sun Jul 31 08:15:24 CEST 2011
Revision: 2202
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2202
Author: trumanblending
Date: 2011-07-31 06:15:24 +0000 (Sun, 31 Jul 2011)
Log Message:
-----------
Fixed an issue when levels > 4 were used, causing tree generation failure
Modified Paths:
--------------
trunk/py/scripts/addons/add_curve_sapling/utils.py
Modified: trunk/py/scripts/addons/add_curve_sapling/utils.py
===================================================================
--- trunk/py/scripts/addons/add_curve_sapling/utils.py 2011-07-31 06:03:00 UTC (rev 2201)
+++ trunk/py/scripts/addons/add_curve_sapling/utils.py 2011-07-31 06:15:24 UTC (rev 2202)
@@ -589,7 +589,7 @@
childStems = branches[2]*(0.2 + 0.8*(branchL/p.lengthPar)/lMax)
elif storeN <= levels - 2:
branchL = (length[n] + uniform(-lengthV[n],lengthV[n]))*(p.lengthPar - 0.6*p.offset)
- childStems = branches[n+1]*(1.0 - 0.5*p.offset/p.lengthPar)
+ childStems = branches[min(3,n+1)]*(1.0 - 0.5*p.offset/p.lengthPar)
# If this is the last level before leaves then we need to generate the child points differently
else:
branchL = (length[n] + uniform(-lengthV[n],lengthV[n]))*(p.lengthPar - 0.6*p.offset)
@@ -915,4 +915,4 @@
for p in armOb.pose.bones:
p.rotation_mode = 'XYZ'
treeOb.parent = armOb
- #print(time.time()-startTime)
+ #print(time.time()-startTime)
\ No newline at end of file
More information about the Bf-extensions-cvs
mailing list