Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index 3acc2e40..8a2aa942 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -65,7 +65,9 @@ class Generator(base_generate.BaseGenerator):
target_rig = meta_data.rigify_target_rig
if not target_rig:
- if "metarig" in self.metarig.name:
+ if meta_data.rigify_rig_basename:
+ rig_new_name = meta_data.rigify_rig_basename
+ elif "metarig" in self.metarig.name:
rig_new_name = self.metarig.name.replace("metarig", "rig")
elif "META" in self.metarig.name:
rig_new_name = self.metarig.name.replace("META", "RIG")
@@ -76,7 +78,7 @@ class Generator(base_generate.BaseGenerator):
target_rig.display_type = 'WIRE'
# If the object is already added to the scene, switch to its collection
- if target_rig.name in self.context.scene.collection.all_objects:
+ if target_rig in list(self.context.scene.collection.all_objects):
self.__switch_to_usable_collection(target_rig)
else:
# Otherwise, add to the selected collection or the metarig collection if unusable
@@ -117,11 +119,14 @@ class Generator(base_generate.BaseGenerator):
wgts_group_name = "WGTS_" + self.obj.name
old_collection = bpy.data.collections.get(wgts_group_name)
+ if old_collection and old_collection.library:
+ old_collection = None
+
if not old_collection:
# Update the old 'Widgets' collection
legacy_collection = bpy.data.collections.get('Widgets')
- if legacy_collection and wgts_group_name in legacy_collection.objects:
+ if legacy_collection and wgts_group_name in legacy_collection.objects and not legacy_collection.library:
legacy_collection.name = wgts_group_name
old_collection = legacy_collection