diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-28 16:05:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-28 16:05:59 +0400 |
commit | 99837ea844882f3d9ff0d0e035b88c587e9ece47 (patch) | |
tree | 98ba29a8bcc1f3d06816dd96a58975569626097a /release/scripts | |
parent | 71958f00527a318e2e31abeb6b6fe6bc990351ce (diff) |
add PoseBone.children convenience attribute.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 819d3e112ff..f7af297a0e0 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -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__ = () |