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/utils
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/utils')
-rw-r--r--rigify/utils/collections.py2
-rw-r--r--rigify/utils/widgets.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/rigify/utils/collections.py b/rigify/utils/collections.py
index 8a299a9b..9eeaac51 100644
--- a/rigify/utils/collections.py
+++ b/rigify/utils/collections.py
@@ -53,7 +53,7 @@ def ensure_collection(context, collection_name, hidden=False) -> bpy.types.Colle
active_collection = active_layer_coll.collection
collection = bpy.data.collections.get(collection_name)
- if not collection:
+ if not collection or collection.library:
# Create the collection
collection = bpy.data.collections.new(collection_name)
collection.hide_viewport = hidden
diff --git a/rigify/utils/widgets.py b/rigify/utils/widgets.py
index e02f3387..ca207ddc 100644
--- a/rigify/utils/widgets.py
+++ b/rigify/utils/widgets.py
@@ -86,6 +86,9 @@ 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:
+ 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
if obj:
# Record the generated widget