From 5ec18ae4abc2ae70f450416d10bd454033b4bd65 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 May 2020 12:42:09 +1000 Subject: Docs: replace warnings with note for complexity information Reserve warnings for situations such as corrupt data which can cause crashes. --- release/scripts/modules/bpy_types.py | 30 ++++++++++++++++++++------- source/blender/makesrna/intern/rna_armature.c | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index a30f9d1dd1d..845e04caaea 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -118,14 +118,19 @@ class Object(bpy_types.ID): @property def children(self): - """All the children of this object. Warning: takes O(len(bpy.data.objects)) time.""" + """All the children of this object. + + .. note:: Takes ``O(len(bpy.data.objects))`` time.""" import bpy return tuple(child for child in bpy.data.objects if child.parent == self) @property def users_collection(self): - """The collections this object is in. Warning: takes O(len(bpy.data.collections) + len(bpy.data.scenes)) time.""" + """ + The collections this object is in. + + .. note:: Takes ``O(len(bpy.data.collections) + len(bpy.data.scenes))`` time.""" import bpy return ( tuple( @@ -139,7 +144,9 @@ class Object(bpy_types.ID): @property def users_scene(self): - """The scenes this object is in. Warning: takes O(len(bpy.data.scenes) * len(bpy.data.objects)) time.""" + """The scenes this object is in. + + .. note:: Takes ``O(len(bpy.data.scenes) * len(bpy.data.objects))`` time.""" import bpy return tuple(scene for scene in bpy.data.scenes if self in scene.objects[:]) @@ -292,12 +299,16 @@ class _GenericBone: @property def children(self): - """A list of all the bones children. Warning: takes O(len(bones)) time.""" + """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] @property def children_recursive(self): - """A list of all children from this bone. Warning: takes O(len(bones)**2) time.""" + """A list of all children from this bone. + + .. note:: Takes ``O(len(bones)**2)`` time.""" bones_children = [] for bone in self._other_bones: index = bone.parent_index(self) @@ -314,7 +325,9 @@ class _GenericBone: Returns a chain of children with the same base name as this bone. Only direct chains are supported, forks caused by multiple children with matching base names will terminate the function - and not be returned. Warning: takes O(len(bones)**2) time. + and not be returned. + + .. note:: Takes ``O(len(bones)**2)`` time. """ basename = self.basename chain = [] @@ -1008,7 +1021,10 @@ class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup): @property def links(self): - """List of node links from or to this socket. Warning: takes O(len(nodetree.links)) time.""" + """ + List of node links from or to this socket. + + .. note:: Takes ``O(len(nodetree.links))`` time.""" return tuple( link for link in self.id_data.links if (link.from_socket == self or diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index cd7875d84e3..8454d5c125f 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -1327,7 +1327,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) prop, "Editbone Matrix", "Matrix combining loc/rot of the bone (head position, direction and roll), " - "in armature space (WARNING: does not include/support bone's length/size)"); + "in armature space (does not include/support bone's length/size)"); RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", "rna_EditBone_matrix_set", NULL); RNA_api_armature_edit_bone(srna); -- cgit v1.2.3