[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2256] trunk/py/scripts/addons/ add_curve_sapling: Version 0.2.5:
Andrew Hale
TrumanBlending at gmail.com
Mon Aug 22 09:56:28 CEST 2011
Revision: 2256
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2256
Author: trumanblending
Date: 2011-08-22 07:56:27 +0000 (Mon, 22 Aug 2011)
Log Message:
-----------
Version 0.2.5:
- Fixed the assignment of vertex groups for rectangular leaves. Fix thanks to pawel_xx
- Compressed the UI to make accessing the different parameters easier. Also, the tree is not rebuilt every time a new menu section is accessed.
Modified Paths:
--------------
trunk/py/scripts/addons/add_curve_sapling/__init__.py
trunk/py/scripts/addons/add_curve_sapling/utils.py
Modified: trunk/py/scripts/addons/add_curve_sapling/__init__.py
===================================================================
--- trunk/py/scripts/addons/add_curve_sapling/__init__.py 2011-08-22 07:13:41 UTC (rev 2255)
+++ trunk/py/scripts/addons/add_curve_sapling/__init__.py 2011-08-22 07:56:27 UTC (rev 2256)
@@ -19,9 +19,9 @@
bl_info = {
"name": "Sapling",
"author": "Andrew Hale (TrumanBlending)",
- "version": (0, 2, 4),
- "blender": (2, 5, 8),
- "api": 38479,
+ "version": (0, 2, 5),
+ "blender": (2, 5, 9),
+ "api": 39307,
"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 "
@@ -156,231 +156,241 @@
bl_label = "Sapling"
bl_options = {'REGISTER', 'UNDO'}
+
+ def update_tree(self, context):
+ self.do_update = True
+
+ def no_update_tree(self, context):
+ self.do_update = False
+
+ do_update = BoolProperty(name='Do Update',
+ default=True, options={'HIDDEN'})
+
chooseSet = EnumProperty(name='Settings',
description='Choose the settings to modify',
items=settings,
- default='0')
+ default='0', update=no_update_tree)
bevel = BoolProperty(name='Bevel',
description='Whether the curve is bevelled',
- default=False)
+ default=False, update=update_tree)
prune = BoolProperty(name='Prune',
description='Whether the tree is pruned',
- default=False)
+ default=False, update=update_tree)
showLeaves = BoolProperty(name='Show Leaves',
description='Whether the leaves are shown',
- default=False)
+ default=False, update=update_tree)
useArm = BoolProperty(name='Use Armature',
description='Whether the armature is generated',
- default=False)
+ default=False, update=update_tree)
seed = IntProperty(name='Random Seed',
description='The seed of the random number generator',
- default=0)
+ default=0, update=update_tree)
handleType = IntProperty(name='Handle Type',
description='The type of curve handles',
min=0,
max=1,
- default=0)
+ default=0, update=update_tree)
levels = IntProperty(name='Levels',
description='Number of recursive branches (Levels)',
min=1,
max=6,
- default=3)
+ default=3, update=update_tree)
length = FloatVectorProperty(name='Length',
description='The relative lengths of each branch level (nLength)',
min=0.0,
default=[1, 0.3, 0.6, 0.45],
- size=4)
+ size=4, update=update_tree)
lengthV = FloatVectorProperty(name='Length Variation',
description='The relative length variations of each level (nLengthV)',
min=0.0,
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
branches = IntVectorProperty(name='Branches',
description='The number of branches grown at each level (nBranches)',
min=0,
default=[50, 30, 10, 10],
- size=4)
+ size=4, update=update_tree)
curveRes = IntVectorProperty(name='Curve Resolution',
description='The number of segments on each branch (nCurveRes)',
min=1,
default=[3, 5, 3, 1],
- size=4)
+ size=4, update=update_tree)
curve = FloatVectorProperty(name='Curvature',
description='The angle of the end of the branch (nCurve)',
default=[0, -40, -40, 0],
- size=4)
+ size=4, update=update_tree)
curveV = FloatVectorProperty(name='Curvature Variation',
description='Variation of the curvature (nCurveV)',
default=[20, 50, 75, 0],
- size=4)
+ size=4, update=update_tree)
curveBack = FloatVectorProperty(name='Back Curvature',
description='Curvature for the second half of a branch (nCurveBack)',
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
baseSplits = IntProperty(name='Base Splits',
description='Number of trunk splits at its base (nBaseSplits)',
min=0,
- default=0)
+ default=0, update=update_tree)
segSplits = FloatVectorProperty(name='Segment Splits',
description='Number of splits per segment (nSegSplits)',
min=0,
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
splitAngle = FloatVectorProperty(name='Split Angle',
description='Angle of branch splitting (nSplitAngle)',
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
splitAngleV = FloatVectorProperty(name='Split Angle Variation',
description='Variation in the split angle (nSplitAngleV)',
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
scale = FloatProperty(name='Scale',
description='The tree scale (Scale)',
min=0.0,
- default=13.0)
+ default=13.0, update=update_tree)
scaleV = FloatProperty(name='Scale Variation',
description='The variation in the tree scale (ScaleV)',
- default=3.0)
+ default=3.0, update=update_tree)
attractUp = FloatProperty(name='Vertical Attraction',
description='Branch upward attraction',
- default=0.0)
+ default=0.0, update=update_tree)
shape = EnumProperty(name='Shape',
description='The overall shape of the tree (Shape)',
items=shapeList,
- default='7')
+ default='7', update=update_tree)
baseSize = FloatProperty(name='Base Size',
description='Fraction of tree height with no branches (BaseSize)',
min=0.0,
max=1.0,
- default=0.4)
+ default=0.4, update=update_tree)
ratio = FloatProperty(name='Ratio',
description='Base radius size (Ratio)',
min=0.0,
- default=0.015)
+ default=0.015, update=update_tree)
taper = FloatVectorProperty(name='Taper',
description='The fraction of tapering on each branch (nTaper)',
min=0.0,
max=1.0,
default=[1, 1, 1, 1],
- size=4)
+ size=4, update=update_tree)
ratioPower = FloatProperty(name='Branch Radius Ratio',
description=('Power which defines the radius of a branch compared to '
'the radius of the branch it grew from (RatioPower)'),
min=0.0,
- default=1.2)
+ default=1.2, update=update_tree)
downAngle = FloatVectorProperty(name='Down Angle',
description=('The angle between a new branch and the one it grew '
'from (nDownAngle)'),
default=[90, 60, 45, 45],
- size=4)
+ size=4, update=update_tree)
downAngleV = FloatVectorProperty(name='Down Angle Variation',
description='Variation in the down angle (nDownAngleV)',
default=[0, -50, 10, 10],
- size=4)
+ size=4, update=update_tree)
rotate = FloatVectorProperty(name='Rotate Angle',
description=('The angle of a new branch around the one it grew from '
'(nRotate)'),
default=[140, 140, 140, 77],
- size=4)
+ size=4, update=update_tree)
rotateV = FloatVectorProperty(name='Rotate Angle Variation',
description='Variation in the rotate angle (nRotateV)',
default=[0, 0, 0, 0],
- size=4)
+ size=4, update=update_tree)
scale0 = FloatProperty(name='Radius Scale',
description='The scale of the trunk radius (0Scale)',
min=0.0,
- default=1.0)
+ default=1.0, update=update_tree)
scaleV0 = FloatProperty(name='Radius Scale Variation',
description='Variation in the radius scale (0ScaleV)',
- default=0.2)
+ default=0.2, update=update_tree)
pruneWidth = FloatProperty(name='Prune Width',
description='The width of the envelope (PruneWidth)',
min=0.0,
- default=0.4)
+ default=0.4, update=update_tree)
pruneWidthPeak = FloatProperty(name='Prune Width Peak',
description=('Fraction of envelope height where the maximum width '
'occurs (PruneWidthPeak)'),
min=0.0,
- default=0.6)
+ default=0.6, update=update_tree)
prunePowerHigh = FloatProperty(name='Prune Power High',
description=('Power which determines the shape of the upper portion '
'of the envelope (PrunePowerHigh)'),
- default=0.5)
+ default=0.5, update=update_tree)
prunePowerLow = FloatProperty(name='Prune Power Low',
description=('Power which determines the shape of the lower portion '
'of the envelope (PrunePowerLow)'),
- default=0.001)
+ default=0.001, update=update_tree)
pruneRatio = FloatProperty(name='Prune Ratio',
description='Proportion of pruned length (PruneRatio)',
min=0.0,
max=1.0,
- default=1.0)
+ default=1.0, update=update_tree)
leaves = IntProperty(name='Leaves',
description='Maximum number of leaves per branch (Leaves)',
- default=25)
+ default=25, update=update_tree)
leafScale = FloatProperty(name='Leaf Scale',
description='The scaling applied to the whole leaf (LeafScale)',
min=0.0,
- default=0.17)
+ default=0.17, update=update_tree)
leafScaleX = FloatProperty(name='Leaf Scale X',
description=('The scaling applied to the x direction of the leaf '
'(LeafScaleX)'),
min=0.0,
- default=1.0)
+ default=1.0, update=update_tree)
leafShape = leafDist = EnumProperty(name='Leaf Shape',
description='The shape of the leaves, rectangular are UV mapped',
items=(('hex', 'Hexagonal', '0'), ('rect', 'Rectangular', '1')),
- default='hex')
+ default='hex', update=update_tree)
bend = FloatProperty(name='Leaf Bend',
description='The proportion of bending applied to the leaf (Bend)',
min=0.0,
max=1.0,
- default=0.0)
+ default=0.0, update=update_tree)
leafDist = EnumProperty(name='Leaf Distribution',
description='The way leaves are distributed on branches',
items=shapeList,
- default='4')
+ default='4', update=update_tree)
bevelRes = IntProperty(name='Bevel Resolution',
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list