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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-07 14:59:40 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-07 15:01:01 +0300
commit58a12594690a556afd0ea1a97eb5d6496e7b50b9 (patch)
treeb4daec399acaa0ebe192f92627ed4df095c8f364 /release/scripts/modules/bpy_types.py
parent9c68ac0448b69b9d05380dc8665fb1f6a28f2edf (diff)
Fix object.users_collection not including scene collections.
Diffstat (limited to 'release/scripts/modules/bpy_types.py')
-rw-r--r--release/scripts/modules/bpy_types.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index f12b259362a..32e8fe40c6a 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -120,10 +120,12 @@ class Object(bpy_types.ID):
@property
def users_collection(self):
- """The collections this object is in. Warning: takes O(len(bpy.data.collections)) time."""
+ """The collections this object is in. Warning: takes O(len(bpy.data.collections) + len(bpy.data.scenes)) time."""
import bpy
return tuple(collection for collection in bpy.data.collections
- if self in collection.objects[:])
+ if self in collection.objects[:]) + \
+ tuple(scene.collection for scene in bpy.data.scenes
+ if self in scene.collection.objects[:])
@property
def users_scene(self):