[Bf-blender-cvs] [798e5930028] master: Fix T87189: Copy/pasting IDs does not handle properly instantiation.

Bastien Montagne noreply at git.blender.org
Fri Oct 1 12:25:01 CEST 2021


Commit: 798e59300280605b8886d9a1f52e1fcf8e5ac008
Author: Bastien Montagne
Date:   Fri Oct 1 12:18:56 2021 +0200
Branches: master
https://developer.blender.org/rB798e59300280605b8886d9a1f52e1fcf8e5ac008

Fix T87189: Copy/pasting IDs does not handle properly instantiation.

Copy/Paste uses its own code path for ID linking, which was not setting
`LIB_TAG_DOIT` for proper instantiation later on.

Would be nice the make this logic closer to the rest of the link/append
code at some point, but for now this fix will do.

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

M	source/blender/blenloader/intern/readfile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 85fc6c2ad70..3ee5e41bf1f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4788,6 +4788,13 @@ int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const uint64_t id_t
       ListBase *lb = which_libbase(mainl, GS(id->name));
       id_sort_by_name(lb, id, NULL);
 
+      /* Tag as loose object (or data associated with objects)
+       * needing to be instantiated (see also #link_named_part and its usage of
+       * #BLO_LIBLINK_NEEDS_ID_TAG_DOIT above). */
+      if (library_link_idcode_needs_tag_check(GS(id->name), BLO_LIBLINK_NEEDS_ID_TAG_DOIT)) {
+        id->tag |= LIB_TAG_DOIT;
+      }
+
       if (bhead->code == ID_OB) {
         /* Instead of instancing Base's directly, postpone until after collections are loaded
          * otherwise the base's flag is set incorrectly when collections are used */



More information about the Bf-blender-cvs mailing list