diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-20 16:07:32 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-20 16:14:57 +0300 |
commit | 2677601fa28eb32576ba28ad6188935c6b9ef831 (patch) | |
tree | 1513efca943b0c6726fd59f08bdd6e232a9a6c8d /rigify | |
parent | 9aade9d926fc88b50a93e396ef3d77a7a08116d7 (diff) |
Fix T65949: rigify error when generating rig
Only objects in the current view layer can be deselected, this would throw an
error when there exist objects not in the current view layer.
Diffstat (limited to 'rigify')
-rw-r--r-- | rigify/generate.py | 4 | ||||
-rw-r--r-- | rigify/legacy/generate.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index 8fe734c5..22769a41 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -167,7 +167,7 @@ def generate_rig(context, metarig): collection.objects.link(temp_rig_2) # Select the temp rigs for merging - for objt in scene.objects: + for objt in view_layer.objects: objt.select_set(False) # deselect all objects temp_rig_1.select_set(True) temp_rig_2.select_set(True) @@ -180,7 +180,7 @@ def generate_rig(context, metarig): bpy.ops.object.delete() # Select the generated rig - for objt in scene.objects: + for objt in view_layer.objects: objt.select_set(False) # deselect all objects obj.select_set(True) view_layer.objects.active = obj diff --git a/rigify/legacy/generate.py b/rigify/legacy/generate.py index 33696cf0..7045a012 100644 --- a/rigify/legacy/generate.py +++ b/rigify/legacy/generate.py @@ -122,7 +122,7 @@ def generate_rig(context, metarig): collection.objects.link(temp_rig_2) # Select the temp rigs for merging - for objt in scene.objects: + for objt in view_layer.objects: objt.select_set(False) # deselect all objects temp_rig_1.select_set(True) temp_rig_2.select_set(True) @@ -135,7 +135,7 @@ def generate_rig(context, metarig): bpy.ops.object.delete() # Select the generated rig - for objt in scene.objects: + for objt in view_layer.objects: objt.select_set(False) # deselect all objects obj.select_set(True) view_layer.objects.active = obj |