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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-12-04 00:53:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-12-04 00:53:01 +0300
commit3b0e182f716b2541fc77fe3b4bac18a529143c29 (patch)
treedfb6580ba524446ea3c237d488e0b9a519c3135a /release
parenta4d8c4a7452669d56a7b7a21b50f96f00d783e0e (diff)
- property decorators for setting attributes didnt work, hack to prevent every instance of an BPyStructRNA to have its own dictionary, set the tp_dictoffset to 0. attempted to use __slots__ but this doesnt work for some reason.
- made bone.length writable
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_types.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 4351ee7579b..565f0e4da1b 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -88,6 +88,11 @@ class _GenericBone:
@property
def length(self):
return (self.head - self.tail).length
+
+ @length.setter
+ def length(self, value):
+ """The distance from head to tail"""
+ self.tail = self.head + ((self.tail - self.head).normalize() * value)
@property
def children(self):