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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rigify/utils.py')
-rw-r--r--rigify/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/rigify/utils.py b/rigify/utils.py
index 23596b3c..2722659d 100644
--- a/rigify/utils.py
+++ b/rigify/utils.py
@@ -1290,9 +1290,11 @@ def ensure_widget_collection(context):
collection.children.link(widget_collection)
widget_layer_collection = [c for c in layer_collection.children if c.collection == widget_collection][0]
+ elif widget_collection == view_layer.layer_collection.collection:
+ widget_layer_collection = view_layer.layer_collection
else:
- widget_layer_collection = get_layer_collection_from_collection(view_layer.collections, widget_collection)
+ widget_layer_collection = get_layer_collection_from_collection(view_layer.layer_collection.children, widget_collection)
# Make the widget the active collection for the upcoming added (widget) objects
- view_layer.collections.active = widget_layer_collection
+ view_layer.active_layer_collection = widget_layer_collection
return widget_collection