[Bf-blender-cvs] [f4017415448] master: PyDoc: remove multiple `children` properties for Bone type
Campbell Barton
noreply at git.blender.org
Tue Apr 19 04:32:58 CEST 2022
Commit: f4017415448fd38f879a2e4bbf7a9f0d85050f1e
Author: Campbell Barton
Date: Tue Apr 19 12:17:23 2022 +1000
Branches: master
https://developer.blender.org/rBf4017415448fd38f879a2e4bbf7a9f0d85050f1e
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.
===================================================================
M release/scripts/modules/bpy_types.py
===================================================================
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
More information about the Bf-blender-cvs
mailing list