add PoseBone.children convenience attribute.

This commit is contained in:
Campbell Barton
2013-09-28 12:05:59 +00:00
parent 71958f0052
commit 99837ea844

View File

@@ -306,6 +306,15 @@ class _GenericBone:
class PoseBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup):
__slots__ = ()
@property
def children(self):
obj = self.id_data
pbones = obj.pose.bones
self_bone = self.bone
return tuple(pbones[bone.name] for bone in obj.data.bones
if bone.parent == self_bone)
class Bone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup):
__slots__ = ()