Docs: replace warnings with note for complexity information

Reserve warnings for situations such as corrupt data which can
cause crashes.
This commit is contained in:
Campbell Barton 2020-05-29 12:42:09 +10:00
parent 2deb6c5177
commit 5ec18ae4ab
2 changed files with 24 additions and 8 deletions

View File

@ -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

View File

@ -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);