Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Hale <TrumanBlending@gmail.com>2011-12-10 15:33:25 +0400
committerAndrew Hale <TrumanBlending@gmail.com>2011-12-10 15:33:25 +0400
commit7b3950ad951e17890074c32f4bd09ba544e694fa (patch)
tree2339b43b4edea253276aaa5d8aef9c07939d1378 /add_curve_sapling
parentb7fd7a03f778b4231a517270ebdb8e1b36b2a090 (diff)
Fix for 2 bugs:
- Setting any of the branch lengths to 0.0 results in divide by zero. Min value for the length setting is now 0.000001 - Preset export failed with the change to the way that vector properties were stored. Now we just store a slice copy of the vector in the export.
Diffstat (limited to 'add_curve_sapling')
-rw-r--r--add_curve_sapling/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py
index 6c8a7897..8cac1aeb 100644
--- a/add_curve_sapling/__init__.py
+++ b/add_curve_sapling/__init__.py
@@ -197,7 +197,7 @@ class AddTree(bpy.types.Operator):
default=3, update=update_tree)
length = FloatVectorProperty(name='Length',
description='The relative lengths of each branch level (nLength)',
- min=0.0,
+ min=0.000001,
default=[1, 0.3, 0.6, 0.45],
size=4, update=update_tree)
lengthV = FloatVectorProperty(name='Length Variation',
@@ -432,12 +432,12 @@ class AddTree(bpy.types.Operator):
# so we need something custom. This is it
data = []
for a, b in (self.as_keywords(ignore=("chooseSet", "presetName", "limitImport", "do_update"))).items():
- # If the property is a vector property then evaluate it and
- # convert to a string
- if (repr(b))[:3] == 'bpy':
- data.append((a, eval('(self.' + a + ')[:]')))
+ # If the property is a vector property then add the slice to the list
+ try:
+ len(b)
+ data.append((a, b[:]))
# Otherwise, it is fine so just add it
- else:
+ except:
data.append((a, b))
# Create the dict from the list
data = dict(data)