diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-06 19:29:00 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-06 19:29:00 +0300 |
commit | f6a54aa234d6d59ceac15f2944c2ddc5f29aac0a (patch) | |
tree | 87351e1e2542eb642ffb044f9508040d8cfbe443 /rigify/legacy | |
parent | 7461a6811331bee00e4e6f3c642e05ebcae75add (diff) |
Updates for change in ViewLayer RNA API.
Diffstat (limited to 'rigify/legacy')
-rw-r--r-- | rigify/legacy/generate.py | 2 | ||||
-rw-r--r-- | rigify/legacy/utils.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/rigify/legacy/generate.py b/rigify/legacy/generate.py index 9a39e333..77c4e28e 100644 --- a/rigify/legacy/generate.py +++ b/rigify/legacy/generate.py @@ -435,7 +435,7 @@ def generate_rig(context, metarig): #---------------------------------- # Restore active collection - view_layer.collections.active = layer_collection + view_layer.active_layer_collection = layer_collection def get_bone_rigs(obj, bone_name, halt_on_missing=False): diff --git a/rigify/legacy/utils.py b/rigify/legacy/utils.py index 0f3a092e..1f017022 100644 --- a/rigify/legacy/utils.py +++ b/rigify/legacy/utils.py @@ -965,9 +965,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 |