Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-04-22 12:35:28 +0300
committerBastien Montagne <bastien@blender.org>2020-04-22 12:37:09 +0300
commit1998154ff4035d57cfc16ffa89ce550b2d998def (patch)
tree581f8b954c0dab3f2b49de1242f5b4c7a0249e92
parent0faeca806c012cfb9e07e30254a1d7d1e6146b15 (diff)
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...
-rw-r--r--source/blender/blenloader/intern/writefile.c6
1 files changed, 6 insertions, 0 deletions
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);