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:
authorAlexander Gavrilov <angavrilov@gmail.com>2022-07-11 20:32:12 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-07-11 20:32:12 +0300
commitd2325587d73bc825986af3a1baba51cb4a9ce355 (patch)
treee6fbdffa8e24c17648ab19e84a736b6428db78e4 /rigify/generate.py
parent6af061bc26e95caf534ee60d6848967d14b97d7b (diff)
Rigify: fix T99352 - generation issues when same named rig is linked.
Only consider local datablocks when searching for the rig object, widget collection and widget objects themselves during generation.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index 3acc2e40..53b47b00 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -76,7 +76,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 +117,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.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