diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index d1a5bfce52a..73e09cef703 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -1604,7 +1604,7 @@ static void blo_cache_storage_entry_register( /** Restore a cache data entry from old ID into new one, when reading some undo memfile. */ static void blo_cache_storage_entry_restore_in_new( - ID * /*id*/, const IDCacheKey *key, void **cache_p, uint flags, void *cache_storage_v) + ID *id, const IDCacheKey *key, void **cache_p, uint flags, void *cache_storage_v) { BLOCacheStorage *cache_storage = static_cast(cache_storage_v); @@ -1618,6 +1618,15 @@ static void blo_cache_storage_entry_restore_in_new( return; } + /* Assume that when ID source is tagged as changed, its caches need to be cleared. + * NOTE: This is mainly a work-around for some IDs, like Image, which use a non-depsgraph-handled + * process for part of their updates. + */ + if (id->recalc & ID_RECALC_SOURCE) { + *cache_p = nullptr; + return; + } + BLOCacheStorageValue *storage_value = static_cast( BLI_ghash_lookup(cache_storage->cache_map, key)); if (storage_value == nullptr) { diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index acc1efe8d12..716b9427e53 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -625,7 +625,7 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, if (GS(id->name) == ID_IM) { Image *ima = (Image *)id; - DEG_id_tag_update(&ima->id, 0); + DEG_id_tag_update(&ima->id, ID_RECALC_ALL); BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_COLORMANAGE);