Skip to content
Snippets Groups Projects
Commit 9f59c24f authored by Alexander Gavrilov's avatar Alexander Gavrilov
Browse files

Rigify: fix exceptions when generating from scratch.

parent d2325587
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ class Generator(base_generate.BaseGenerator): ...@@ -117,7 +117,7 @@ class Generator(base_generate.BaseGenerator):
wgts_group_name = "WGTS_" + self.obj.name wgts_group_name = "WGTS_" + self.obj.name
old_collection = bpy.data.collections.get(wgts_group_name) old_collection = bpy.data.collections.get(wgts_group_name)
if old_collection.library: if old_collection and old_collection.library:
old_collection = None old_collection = None
if not old_collection: if not old_collection:
......
...@@ -86,7 +86,7 @@ def create_widget(rig, bone_name, bone_transform_name=None, *, widget_name=None, ...@@ -86,7 +86,7 @@ def create_widget(rig, bone_name, bone_transform_name=None, *, widget_name=None,
if not obj: if not obj:
# Search the scene by name # Search the scene by name
obj = scene.objects.get(obj_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] 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 obj = local_objs[0] if local_objs else None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment