From 27b9f1f626294173269af85ef0d928d059179598 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 1 Apr 2020 10:12:19 +0200 Subject: Writefile: Cleanup MBall runtime data. --- source/blender/blenloader/intern/writefile.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index f28063bc691..a8f219ccf84 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2026,6 +2026,14 @@ static void write_camera(WriteData *wd, Camera *cam, const void *id_address) static void write_mball(WriteData *wd, MetaBall *mb, const void *id_address) { if (mb->id.us > 0 || wd->use_memfile) { + /* Clean up, important in undo case to reduce false detection of changed datablocks. */ + BLI_listbase_clear(&mb->disp); + mb->editelems = NULL; + /* Must always be cleared (meta's don't have their own edit-data). */ + mb->needs_flush_to_id = 0; + mb->lastelem = NULL; + mb->batch_cache = NULL; + /* write LibData */ writestruct_at_address(wd, ID_MB, MetaBall, 1, id_address, mb); write_iddata(wd, &mb->id); -- cgit v1.2.3