Fix (unreported) BKE_main_id_refcount_recompute wrong handling of some ID types.

Scene, WindowManager and Workspace types of IDs should always have a
'virtual' user, to ensure they are always written to file.
This commit is contained in:
Bastien Montagne
2023-05-13 19:26:02 +02:00
parent 5a2f159ba4
commit b960a4fdb8

View File

@@ -1666,6 +1666,10 @@ void BKE_main_id_refcount_recompute(struct Main *bmain, const bool do_linked_onl
id->tag &= ~(LIB_TAG_EXTRAUSER | LIB_TAG_EXTRAUSER_SET);
id_us_ensure_real(id);
}
if (ELEM(GS(id->name), ID_SCE, ID_WM, ID_WS)) {
/* These IDs should always have a 'virtual' user. */
id_us_ensure_real(id);
}
}
FOREACH_MAIN_ID_END;