[Bf-blender-cvs] [1998154ff40] blender-v2.83-release: Undo: Minor optimization: do not write Scene's 3DCursor.

Bastien Montagne noreply at git.blender.org
Wed Apr 22 11:37:16 CEST 2020


Commit: 1998154ff4035d57cfc16ffa89ce550b2d998def
Author: Bastien Montagne
Date:   Wed Apr 22 11:35:28 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB1998154ff4035d57cfc16ffa89ce550b2d998def

Undo: Minor optimization: do not write Scene's 3DCursor.

Probably not much gained here, but that's one thing less potentially
making the scene seen as changed in undo steps...

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

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

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

diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ee5e6f4610a..8c79d9ac431 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2577,6 +2577,12 @@ static void write_lightcache(WriteData *wd, LightCache *cache)
 
 static void write_scene(WriteData *wd, Scene *sce, const void *id_address)
 {
+  if (wd->use_memfile) {
+    /* Clean up, important in undo case to reduce false detection of changed datablocks. */
+    /* XXX This UI data should not be stored in Scene at all... */
+    memset(&sce->cursor, 0, sizeof(sce->cursor));
+  }
+
   /* write LibData */
   writestruct_at_address(wd, ID_SCE, Scene, 1, id_address, sce);
   write_iddata(wd, &sce->id);



More information about the Bf-blender-cvs mailing list