diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-06 10:49:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-06 10:49:55 +0300 |
commit | f7123f0f11c747847a0b5f785fe393f073efcc1d (patch) | |
tree | 2f526f18ed47e9a4bd34cae02ea9d66e3d436779 /source/blender/windowmanager | |
parent | 4163beb818fc743e5b0e1388fece488156027555 (diff) |
WM: manipulator redo support
Support for adjusting a setting from the last executed operator.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/manipulators/WM_manipulator_types.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h index 8a5580582d7..e4482e797e3 100644 --- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h +++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h @@ -153,6 +153,8 @@ typedef struct wmManipulatorOpElem { /* operator properties if manipulator spawns and controls an operator, * or owner pointer if manipulator spawns and controls a property */ PointerRNA ptr; + + bool is_redo; } wmManipulatorOpElem; /* manipulators are set per region by registering them on manipulator-maps */ diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c index 31861df1db2..3d7403dc0e1 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c @@ -54,6 +54,7 @@ #include "wm_event_system.h" #include "ED_screen.h" +#include "ED_undo.h" /* own includes */ #include "wm_manipulator_wmapi.h" @@ -357,6 +358,21 @@ static bool manipulator_tweak_start_and_finish( *r_is_modal = false; } if (mpop && mpop->type) { + + /* Undo/Redo */ + if (mpop->is_redo) { + wmWindowManager *wm = CTX_wm_manager(C); + wmOperator *op = WM_operator_last_redo(C); + + /* We may want to enable this, for now the manipulator can manage it's own properties. */ +#if 0 + IDP_MergeGroup(mpop->ptr.data, op->properties, false); +#endif + + WM_operator_free_all_after(wm, op); + ED_undo_pop_op(C, op); + } + /* XXX temporary workaround for modal manipulator operator * conflicting with modal operator attached to manipulator */ if (mpop->type->modal) { |