[Bf-extensions-cvs] [9f59c24f] master: Rigify: fix exceptions when generating from scratch.

Alexander Gavrilov noreply at git.blender.org
Tue Jul 12 17:19:12 CEST 2022


Commit: 9f59c24f1f3b75550a8189bf4080cc7e19838837
Author: Alexander Gavrilov
Date:   Tue Jul 12 18:04:32 2022 +0300
Branches: master
https://developer.blender.org/rBA9f59c24f1f3b75550a8189bf4080cc7e19838837

Rigify: fix exceptions when generating from scratch.

===================================================================

M	rigify/generate.py
M	rigify/utils/widgets.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list