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.
This commit is contained in:
Bastien Montagne
2024-05-29 17:38:08 +02:00
parent 50bf1f3a52
commit b32d026441

View File

@@ -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);
}