Fix: Core: Also run BKE_main_id_indirect_linked_update after linking.

This call not only revalidate the whole direct/indirect status of all
linked IDs, it also ensures that the ID tags themselves are in a valid
state.

This can get invalid during some of the versionning code doing raw
direct tags manipulation e.g.

Regular readfile code was already using it, now add the same call to the
linking code too.

See also:
https://projects.blender.org/llm-test/llm-reports/src/branch/main/llm_review/log_2026_w32.md#fix-core-id-created-in-libraries-not-properly-tagged
This commit is contained in:
Bastien Montagne 2026-08-06 10:53:51 +02:00
parent a91a10d785
commit c596762b20

View file

@ -4634,6 +4634,9 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
/* Update invariants after re-generating overrides. */
BKE_main_ensure_invariants(*bfd->main);
/* Some versioning code can leave some ID link status tags in invalid state, due to low-level
* manipulations of these instead of using API like `id_lib_extern`, which will be also fixed
* by this call. */
BKE_main_id_indirect_linked_update(*bfd->main);
fd->reports->duration.lib_overrides = BLI_time_now_seconds() -
@ -5589,6 +5592,12 @@ static void library_link_end(Main *mainl, FileData **fd, const int flag, ReportL
BKE_main_collections_parent_relations_rebuild(mainvar);
}
/* Linking may have changed some data link status.
* Further more, some versioning code can leave some ID link status tags in invalid state, due to
* low-level manipulations of these instead of using API like `id_lib_extern`, which will be also
* fixed by this call. */
BKE_main_id_indirect_linked_update(*mainvar);
/* Make all relative paths, relative to the open blend file. */
fix_relpaths_library(BKE_main_blendfile_path(mainvar), mainvar);