[Bf-extensions-cvs] [4110b33] master: Fix T43837: Can't change amount of leaves.

Bastien Montagne noreply at git.blender.org
Sat Feb 28 11:04:23 CET 2015


Commit: 4110b333b15014c19e5e343e3bd4e5370df3b48e
Author: Bastien Montagne
Date:   Sat Feb 28 11:03:34 2015 +0100
Branches: master
https://developer.blender.org/rBA4110b333b15014c19e5e343e3bd4e5370df3b48e

Fix T43837: Can't change amount of leaves.

Leaves settings were simply never used (broken logic, dead branch code)...

===================================================================

M	add_curve_sapling/__init__.py
M	add_curve_sapling/utils.py

===================================================================

diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py
index 7e09fb2..f36ab55 100644
--- a/add_curve_sapling/__init__.py
+++ b/add_curve_sapling/__init__.py
@@ -20,7 +20,7 @@ bl_info = {
     "name": "Sapling",
     "author": "Andrew Hale (TrumanBlending)",
     "version": (0, 2, 6),
-    "blender": (2, 71, 0),
+    "blender": (2, 73, 0),
     "location": "View3D > Add > Curve",
     "description": ("Adds a parametric tree. The method is presented by "
     "Jason Weber & Joseph Penn in their paper 'Creation and Rendering of "
@@ -189,7 +189,7 @@ class AddTree(bpy.types.Operator):
         max=1,
         default=0, update=update_tree)
     levels = IntProperty(name='Levels',
-        description='Number of recursive branches (Levels)',
+        description='Number of recursive branches (Levels, note that last level is also used for generating leaves)',
         min=1,
         max=6,
         default=3, update=update_tree)
diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py
index b774072..c3bcbe7 100644
--- a/add_curve_sapling/utils.py
+++ b/add_curve_sapling/utils.py
@@ -586,7 +586,7 @@ def fabricate_stems(addsplinetobone, addstem, baseSize, branches, childP, cu, cu
         tempPos.rotate(rotMat)
         tempPos.rotate(p.quat)
         newPoint.handle_right = p.co + tempPos
-        if (storeN >= levels):
+        if (storeN == levels - 1):
             # If this is the last level before leaves then we need to generate the child points differently
             branchL = (length[n] + uniform(-lengthV[n], lengthV[n])) * (p.lengthPar - 0.6 * p.offset)
             if leaves < 0:



More information about the Bf-extensions-cvs mailing list