diff options
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b0f0a08651c..38dc63af1fe 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6553,6 +6553,9 @@ static void read_libblock_undo_restore_identical( if (ob->proxy != NULL) { ob->proxy->proxy_from = ob; } + /* For undo we stay in object mode during undo presses, so keep editmode disabled for re-used + * data-blocks too. */ + ob->mode &= ~OB_MODE_EDIT; } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b3e937a29b2..183ed3668b7 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1303,10 +1303,17 @@ static void write_shaderfxs(BlendWriter *writer, ListBase *fxbase) static void write_object(BlendWriter *writer, Object *ob, const void *id_address) { - if (ob->id.us > 0 || BLO_write_is_undo(writer)) { + const bool is_undo = BLO_write_is_undo(writer); + if (ob->id.us > 0 || is_undo) { /* Clean up, important in undo case to reduce false detection of changed datablocks. */ BKE_object_runtime_reset(ob); + if (is_undo) { + /* For undo we stay in object mode during undo presses, so keep editmode disabled on save as + * well, can help reducing false detection of changed datablocks. */ + ob->mode &= ~OB_MODE_EDIT; + } + /* write LibData */ BLO_write_id_struct(writer, Object, id_address, &ob->id); BKE_id_blend_write(writer, &ob->id); |