[Bf-blender-cvs] [7f5bae28db0] blender2.7: Fix memfile undo decoding creating undo steps

Campbell Barton noreply at git.blender.org
Wed Jan 9 22:07:58 CET 2019


Commit: 7f5bae28db0ce3d3bb62c66b45bba1fedfecaf93
Author: Campbell Barton
Date:   Wed Jan 9 16:53:44 2019 +1100
Branches: blender2.7
https://developer.blender.org/rB7f5bae28db0ce3d3bb62c66b45bba1fedfecaf93

Fix memfile undo decoding creating undo steps

Exiting modes shouldn't be needed since loading the new memfile
will free the old data.

Sculpt mode dynamic topology was adding undo data on exiting the mode
which isn't logical in this case and can be avoided altogether.

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

M	source/blender/editors/undo/memfile_undo.c

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

diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c
index bb81da74f88..e61835fd761 100644
--- a/source/blender/editors/undo/memfile_undo.c
+++ b/source/blender/editors/undo/memfile_undo.c
@@ -76,14 +76,12 @@ static bool memfile_undosys_step_encode(struct bContext *C, UndoStep *us_p)
 	MemFileUndoStep *us_prev = (MemFileUndoStep *)BKE_undosys_step_find_by_type(ustack, BKE_UNDOSYS_TYPE_MEMFILE);
 	us->data = BKE_memfile_undo_encode(bmain, us_prev ? us_prev->data : NULL);
 	us->step.data_size = us->data->undo_size;
+
 	return true;
 }
 
 static void memfile_undosys_step_decode(struct bContext *C, UndoStep *us_p, int UNUSED(dir))
 {
-	/* Loading the content will correctly switch into compatible non-object modes. */
-	ED_object_mode_set(C, OB_MODE_OBJECT);
-
 	/* This is needed so undoing/redoing doesn't crash with threaded previews going */
 	ED_viewport_render_kill_jobs(CTX_wm_manager(C), CTX_data_main(C), true);
 	MemFileUndoStep *us = (MemFileUndoStep *)us_p;



More information about the Bf-blender-cvs mailing list