From 155e540eb7b79e151fdbec3bd891fc8a2ac447c2 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 27 May 2025 18:34:51 +0200 Subject: [PATCH] Fix (unreported) ID copied in libs making their depencies directly linked. Not really critical in current main, since such 'copying in library' behavior is fairly rare, but once it start being applied to e.g. geometry IDs owning shape keys, it would make Blender unhappy because unlinkable IDs (the shape keys) would be tagged as directly linked. --- source/blender/blenkernel/intern/lib_id.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/blenkernel/intern/lib_id.cc b/source/blender/blenkernel/intern/lib_id.cc index 629f06b1552..3e9af31dc14 100644 --- a/source/blender/blenkernel/intern/lib_id.cc +++ b/source/blender/blenkernel/intern/lib_id.cc @@ -638,6 +638,11 @@ static int id_copy_libmanagement_cb(LibraryIDLinkCallbackData *cb_data) BLI_assert(cb_data->self_id->tag & ID_TAG_NO_MAIN); id_us_plus_no_lib(id); } + else if (ID_IS_LINKED(cb_data->owner_id)) { + /* Do not mark copied ID as directly linked, if its current user is also linked data (which + * is now fairly common when using 'copy_in_lib' feature). */ + id_us_plus_no_lib(id); + } else { id_us_plus(id); }