diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:23:12 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-04-01 13:39:06 +0300 |
commit | 1f065df03e66b865137252db594991150c51d1bc (patch) | |
tree | a532d3b48aedbae0f7f16fa9a558cc7b6030b6b3 /source/blender/blenloader | |
parent | ec351c7a653da2b5da6dd91b916deed70bff117e (diff) |
Writefile: Cleanup GPencil data.
Note: Not clearing the whole runtime data here, as this is not done in
matching read code, not sure why, needs further investigation...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index fb6bd637a3b..eb85fc95e4a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2824,6 +2824,14 @@ static void write_scene(WriteData *wd, Scene *sce, const void *id_address) static void write_gpencil(WriteData *wd, bGPdata *gpd, const void *id_address) { if (gpd->id.us > 0 || wd->use_memfile) { + /* Clean up, important in undo case to reduce false detection of changed datablocks. */ + /* XXX not sure why the whole runtime data is not cleared in readcode, for now mimicking it + * here. */ + gpd->runtime.sbuffer = NULL; + gpd->runtime.sbuffer_used = 0; + gpd->runtime.sbuffer_size = 0; + gpd->runtime.tot_cp_points = 0; + /* write gpd data block to file */ writestruct_at_address(wd, ID_GD, bGPdata, 1, id_address, gpd); write_iddata(wd, &gpd->id); |