From 1998154ff4035d57cfc16ffa89ce550b2d998def Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 22 Apr 2020 11:35:28 +0200 Subject: 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... --- source/blender/blenloader/intern/writefile.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3