diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-03-28 23:50:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-30 21:09:15 +0300 |
commit | 22677d8e1d88aca4fe8fb89f51596fb3f7af6934 (patch) | |
tree | f15ed316fdd5af484aeffb3258996f823cc29b5b /source/blender | |
parent | f4982b555c340348a50ee80df0a4bf11074d3b1d (diff) |
Fix undo incorrectly detecting mesh as always changed after edits
Mesh writes a modified copy, which meant recalc_undo_accumulated was never
cleared on the actual datablock. Also clear mesh->runtime on write to avoid
detecting changes, since it's cleared on read anyway.
Differential Revision: https://developer.blender.org/D7274
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 599e592c77d..2c0dcd83cea 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -734,11 +734,6 @@ static void write_iddata(WriteData *wd, ID *id) } } } - - /* Clear the accumulated recalc flags in case of undo step saving. */ - if (wd->use_memfile) { - id->recalc_undo_accumulated = 0; - } } static void write_previews(WriteData *wd, const PreviewImage *prv_orig) @@ -2213,6 +2208,7 @@ static void write_mesh(WriteData *wd, Mesh *mesh) mesh->mface = NULL; mesh->totface = 0; memset(&mesh->fdata, 0, sizeof(mesh->fdata)); + memset(&mesh->runtime, 0, sizeof(mesh->runtime)); /* Reduce xdata layers, fill xlayers with layers to be written. * This makes xdata invalid for Blender, which is why we made a @@ -4142,6 +4138,9 @@ static bool write_file_handle(Main *mainvar, /* Very important to do it after every ID write now, otherwise we cannot know whether a * specific ID changed or not. */ mywrite_flush(wd); + + /* Clear the accumulated recalc flags in case of undo step saving. */ + id->recalc_undo_accumulated = 0; } } |