From 651b8fb14eb6ee5cbfa98bffe80a966a0753b14e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 19 Mar 2018 14:17:59 +0100 Subject: Undo: unified undo system w/ linear history - Use a single undo history for all operations. - UndoType's are registered and poll the context to check if they should be used when performing an undo push. - Mode switching is used to ensure the state is correct before undo data is restored. - Some undo types accumulate changes (image & text editing) others store the state multiple times (with de-duplication). This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`. - Each undo step stores ID datablocks they use with utilities to help manage restoring correct ID's. Needed since global undo is now mixed with other modes undo. - Currently performs each undo step when going up/down history Previously this wasn't done, making history fail in some cases. This can be optimized to skip some combinations of undo steps. grease-pencil is an exception which has not been updated since it integrates undo into the draw-session. See D3113 --- source/blender/editors/render/render_internal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/render/render_internal.c') diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index c27570aabc5..92fb140243f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -65,6 +65,7 @@ #include "BKE_sequencer.h" #include "BKE_screen.h" #include "BKE_scene.h" +#include "BKE_undo_system.h" #include "WM_api.h" #include "WM_types.h" @@ -88,6 +89,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "BLO_undofile.h" #include "render_intern.h" @@ -866,7 +868,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even /* get main */ if (G.debug_value == 101) { /* thread-safety experiment, copy main from the undo buffer */ - mainp = BKE_undo_get_main(&scene); + struct MemFile *memfile = ED_undosys_stack_memfile_get_active(CTX_wm_manager(C)->undo_stack); + mainp = BLO_memfile_main_get(memfile, CTX_data_main(C), &scene); } else mainp = CTX_data_main(C); -- cgit v1.2.3