From f4017415448fd38f879a2e4bbf7a9f0d85050f1e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Apr 2022 12:17:23 +1000 Subject: PyDoc: remove multiple `children` properties for Bone type This doesn't cause any functional change as the RNA property of Bone wasn't overridden by the _GenericBone's property, however the `children` property was documented twice, causing a warning. --- release/scripts/modules/bpy_types.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index be60a1711aa..b3f0c055769 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -371,13 +371,8 @@ class _GenericBone: """ return (self.tail - self.head) - @property - def children(self): - """A list of all the bones children. - - .. note:: Takes ``O(len(bones))`` time.""" - return [child for child in self._other_bones if child.parent == self] - + # NOTE: each bone type is responsible for implementing `children`. + # This is done since `Bone` has direct access to this data in RNA. @property def children_recursive(self): """A list of all children from this bone. @@ -457,10 +452,19 @@ class PoseBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup): class Bone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup): __slots__ = () + # NOTE: `children` is implemented in RNA. + class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup): __slots__ = () + @property + def children(self): + """A list of all the bones children. + + .. note:: Takes ``O(len(bones))`` time.""" + return [child for child in self._other_bones if child.parent == self] + def align_orientation(self, other): """ Align this bone to another by moving its tail and settings its roll -- cgit v1.2.3