diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-26 09:54:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-01-26 10:41:19 +0300 |
commit | c4a4d20d3ddc9e1791fca89f76f14b0ee94b827b (patch) | |
tree | 54ed1a0bc8f43a177ad258f086566bd59f8061df | |
parent | 848f0c5b5b3ca4d747e00a66182c3d0edd8cc99b (diff) |
Fix part of T53080: all material previews re-rendering after undo.
This reverts commit dc2617130b2e1d7d2b9892fbd7c6e7b60caafb66, which disabled
writing of previews for undo. While this uses some memory, re-rendering all
previews is very expensive, especially if for example you have lots of materials
using high-res image textures.
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d7d2dd529f9..c2820ac6e30 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -679,8 +679,10 @@ static void write_iddata(void *wd, const ID *id) static void write_previews(WriteData *wd, const PreviewImage *prv_orig) { - /* Never write previews when doing memsave (i.e. undo/redo)! */ - if (prv_orig && !wd->current) { + /* Note we write previews also for undo steps. It takes up some memory, + * but not doing so would causes all previews to be re-rendered after + * undo which is too expensive. */ + if (prv_orig) { PreviewImage prv = *prv_orig; /* don't write out large previews if not requested */ |