[Bf-blender-cvs] [a63982a65b9] master: Fix T97289: Linked collection assets disappear.

Bastien Montagne noreply at git.blender.org
Wed Apr 13 10:29:00 CEST 2022


Commit: a63982a65b92a9422c6de350cc0528f2fa345a8b
Author: Bastien Montagne
Date:   Wed Apr 13 10:25:53 2022 +0200
Branches: master
https://developer.blender.org/rBa63982a65b92a9422c6de350cc0528f2fa345a8b

Fix T97289: Linked collection assets disappear.

After appending, new link/append code would delete linked IDs, even if
those where pre-existing. Note that this would actually lead to invalid
memory access later in append code (ASAN crash).

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

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 be2abdbfb69..da48365a43e 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -1187,6 +1187,11 @@ void BKE_blendfile_append(BlendfileLinkAppendContext *lapp_context, ReportList *
     BLI_assert(ID_IS_LINKED(id));
     BLI_assert(id->newid != NULL);
 
+    /* Do NOT delete a linked data that was already linked before this append. */
+    if (id->tag & LIB_TAG_PRE_EXISTING) {
+      continue;
+    }
+
     id->tag |= LIB_TAG_DOIT;
     item->new_id = id->newid;
   }



More information about the Bf-blender-cvs mailing list