diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-03 17:09:58 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-03 17:10:33 +0300 |
commit | 3a59c184b98a729ccaa1261d1252e084167f7a32 (patch) | |
tree | 0275fa44c836d394bfba99d8aef5eeb3610e00e3 /source/blender/blenloader | |
parent | a33756d783a99a29aa77373c726a598ec50af80a (diff) |
Move Scene's cache management during undo to new system.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 13 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
2 files changed, 6 insertions, 15 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index e1350f9de66..914eb6c4690 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -390,29 +390,26 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, blo_make_old_idmap_from_main(fd, old_mainlist.first); } + /* TODO: Move handling of nodetree caches to new system as well... */ /* makes lookup of existing images in old main */ blo_make_image_pointer_map(fd, oldmain); - - /* makes lookup of existing light caches in old main */ - blo_make_scene_pointer_map(fd, oldmain); - /* makes lookup of existing video clips in old main */ blo_make_movieclip_pointer_map(fd, oldmain); /* removed packed data from this trick - it's internal data that needs saves */ + /* Store all existing ID caches pointers into a mapping, to allow restoring them into newly + * read IDs whenever possible. */ blo_cache_storage_init(fd, oldmain); bfd = blo_read_file_internal(fd, filename); + /* Ensure relinked caches are not freed together with their old IDs. */ blo_cache_storage_old_bmain_clear(fd, oldmain); - /* ensures relinked light caches are not freed */ - blo_end_scene_pointer_map(fd, oldmain); - + /* TODO: Move handling of nodetree caches to new system as well... */ /* ensures relinked images are not freed */ blo_end_image_pointer_map(fd, oldmain); - /* ensures relinked movie clips are not freed */ blo_end_movieclip_pointer_map(fd, oldmain); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4d411225be3..880a854acfc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6942,13 +6942,7 @@ static void direct_link_scene(BlendDataReader *reader, Scene *sce) } if (reader->fd->memfile) { - /* If it's undo try to recover the cache. */ - if (reader->fd->scenemap) { - sce->eevee.light_cache_data = newsceadr(reader->fd, sce->eevee.light_cache_data); - } - else { - sce->eevee.light_cache_data = NULL; - } + /* If it's undo do nothing here, caches are handled by higher-level generic calling code. */ } else { /* else try to read the cache from file. */ |