[Bf-blender-cvs] [46ae2593909] temp-collection-asssets: Fix indirectly instanced objects being both instanced and linked

Julian Eisel noreply at git.blender.org
Sun Jan 9 00:21:26 CET 2022


Commit: 46ae259390951e11dcf5570ec9c55487e5e7519d
Author: Julian Eisel
Date:   Sun Jan 9 00:09:42 2022 +0100
Branches: temp-collection-asssets
https://developer.blender.org/rB46ae259390951e11dcf5570ec9c55487e5e7519d

Fix indirectly instanced objects being both instanced and linked

When appending a collection using instancing that contains another collection
instance, the object in the contained instance appear twice. Once from the
instanced collection (the one that was appended in the first place), and once
because they get linked to the active collection. Make sure they are not
linked.

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

M	source/blender/blenkernel/intern/blendfile_link_append.c

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

diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c
index 169a410bccc..5a2d5459592 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -693,9 +693,12 @@ static void loose_data_instantiate_collection_process(
     loose_data_instantiate_ensure_active_collection(instantiate_context);
     Collection *active_collection = instantiate_context->active_collection;
 
+    if ((item->tag & LINK_APPEND_TAG_INDIRECT) != 0) {
+      /* Pass */
+    }
     /* In case user requested instantiation of collections as empties, do so for the one they
      * explicitly selected (originally directly linked IDs) only. */
-    if (do_instantiate_as_empty && (item->tag & LINK_APPEND_TAG_INDIRECT) == 0) {
+    else if (do_instantiate_as_empty) {
       /* BKE_object_add(...) messes with the selection. */
       Object *ob = BKE_object_add_only_object(bmain, OB_EMPTY, collection->id.name + 2);
       ob->type = OB_EMPTY;



More information about the Bf-blender-cvs mailing list