diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-07-12 18:04:32 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-07-12 18:05:00 +0300 |
commit | 9f59c24f1f3b75550a8189bf4080cc7e19838837 (patch) | |
tree | 7ea3e22861bd1500348f34c119eb26b9cd7c8dac | |
parent | d2325587d73bc825986af3a1baba51cb4a9ce355 (diff) |
Rigify: fix exceptions when generating from scratch.
-rw-r--r-- | rigify/generate.py | 2 | ||||
-rw-r--r-- | rigify/utils/widgets.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index 53b47b00..d63399cc 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -117,7 +117,7 @@ class Generator(base_generate.BaseGenerator): wgts_group_name = "WGTS_" + self.obj.name old_collection = bpy.data.collections.get(wgts_group_name) - if old_collection.library: + if old_collection and old_collection.library: old_collection = None if not old_collection: diff --git a/rigify/utils/widgets.py b/rigify/utils/widgets.py index ca207ddc..5a16065b 100644 --- a/rigify/utils/widgets.py +++ b/rigify/utils/widgets.py @@ -86,7 +86,7 @@ def create_widget(rig, bone_name, bone_transform_name=None, *, widget_name=None, if not obj: # Search the scene by name obj = scene.objects.get(obj_name) - if obj.library: + if obj and obj.library: local_objs = [obj for obj in scene.objects if obj.name == obj_name and not obj.library] obj = local_objs[0] if local_objs else None |