- 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
This commit is contained in:
2009-12-03 21:53:01 +00:00
parent a4d8c4a745
commit 3b0e182f71
3 changed files with 16 additions and 2 deletions

View File

@@ -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):