[Bf-blender-cvs] [27b9f1f6262] master: Writefile: Cleanup MBall runtime data.

Bastien Montagne noreply at git.blender.org
Wed Apr 1 14:27:36 CEST 2020


Commit: 27b9f1f626294173269af85ef0d928d059179598
Author: Bastien Montagne
Date:   Wed Apr 1 10:12:19 2020 +0200
Branches: master
https://developer.blender.org/rB27b9f1f626294173269af85ef0d928d059179598

Writefile: Cleanup MBall runtime data.

===================================================================

M	source/blender/blenloader/intern/writefile.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list