From 798e59300280605b8886d9a1f52e1fcf8e5ac008 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 1 Oct 2021 12:18:56 +0200 Subject: 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. --- source/blender/blenloader/intern/readfile.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 */ -- cgit v1.2.3