Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-29 05:42:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-29 05:42:09 +0300
commit5ec18ae4abc2ae70f450416d10bd454033b4bd65 (patch)
tree4dc5e310700c172e2b8c42270adc1ead0bab890d /release
parent2deb6c51778701135a54c05043a123a715cde938 (diff)
Docs: replace warnings with note for complexity information
Reserve warnings for situations such as corrupt data which can cause crashes.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_types.py30
1 files changed, 23 insertions, 7 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