From b32d02644121bd37e296eec35b24fd0ffdf3643d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 29 May 2024 17:38:08 +0200 Subject: [PATCH] Fix (studio-reported) unlinkable IDs made directly linked during blendfile write. Regression from 435b6743fd, no usage of unlinkable ID (mainly shapekeys...) should make them directly linked. Note that this had no serious consequences, it was mainly printing annoying error messages in release builds, and asserting in debug ones. --- source/blender/blenloader/intern/writefile.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index c4bd7567758..342f37940b5 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -1194,6 +1194,14 @@ static int write_id_direct_linked_data_process_cb(LibraryIDLinkCallbackData *cb_ return IDWALK_RET_NOP; } + if (!BKE_idtype_idcode_is_linkable(GS(id->name))) { + /* Usages of unlinkable IDs (aka ShapeKeys and some UI IDs) should never cause them to be + * considered as directly linked. This can often happen e.g. from UI data (the Outliner will + * have links to most IDs). + */ + return IDWALK_RET_NOP; + } + if (cb_flag & IDWALK_CB_DIRECT_WEAK_LINK) { id_lib_indirect_weak_link(id); }