Skip to content
Snippets Groups Projects
Commit c83a0e81 authored by Andrew Hale's avatar Andrew Hale
Browse files

Fixed an issue when levels > 4 were used, causing tree generation failure

parent 995e6d58
Branches
Tags
No related merge requests found
...@@ -589,7 +589,7 @@ def addTree(props): ...@@ -589,7 +589,7 @@ def addTree(props):
childStems = branches[2]*(0.2 + 0.8*(branchL/p.lengthPar)/lMax) childStems = branches[2]*(0.2 + 0.8*(branchL/p.lengthPar)/lMax)
elif storeN <= levels - 2: elif storeN <= levels - 2:
branchL = (length[n] + uniform(-lengthV[n],lengthV[n]))*(p.lengthPar - 0.6*p.offset) 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 # If this is the last level before leaves then we need to generate the child points differently
else: else:
branchL = (length[n] + uniform(-lengthV[n],lengthV[n]))*(p.lengthPar - 0.6*p.offset) branchL = (length[n] + uniform(-lengthV[n],lengthV[n]))*(p.lengthPar - 0.6*p.offset)
...@@ -915,4 +915,4 @@ def addTree(props): ...@@ -915,4 +915,4 @@ def addTree(props):
for p in armOb.pose.bones: for p in armOb.pose.bones:
p.rotation_mode = 'XYZ' p.rotation_mode = 'XYZ'
treeOb.parent = armOb treeOb.parent = armOb
#print(time.time()-startTime) #print(time.time()-startTime)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment