diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-03 11:15:34 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-03 11:15:34 +0300 |
commit | cd5ee246565d06240f578e0ffba1310254bbec3e (patch) | |
tree | 00d54d028f81b96bb1023a743f16307328d53983 /source/blender/editors/undo | |
parent | b5a1e3d471ad0657a10596b7f2f47b6c7e0fb3f4 (diff) |
Operators: add a new flag stating that operator needs access to evaluated data.
For now, that flag is only used in redo code, since after undo step
depsgraph is totally empty... We *may* want to add at least an assert in
op calling code too, though?
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r-- | source/blender/editors/undo/ed_undo.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 7c1dc148dde..ffe4008f7d6 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -48,6 +48,7 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_layer.h" #include "BKE_undo_system.h" @@ -414,6 +415,15 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) } } + if (op->type->flag & OPTYPE_USE_EVAL_DATA) { + /* We need to force refresh of depsgraph after undo step, + * redoing the operator *may* rely on some valid evaluated data. */ + Main *bmain = CTX_data_main(C); + scene = CTX_data_scene(C); + ViewLayer *view_layer = CTX_data_view_layer(C); + BKE_scene_view_layer_graph_evaluated_ensure(bmain, scene, view_layer); + } + retval = WM_operator_repeat(C, op); if ((retval & OPERATOR_FINISHED) == 0) { if (G.debug & G_DEBUG) |