diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2016-11-15 13:50:11 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2016-11-15 16:25:10 +0300 |
commit | 69470e36d6b17042260b06f26ca3c2f702747324 (patch) | |
tree | b09f43552eb90264eb8b59c83b3ff997cbff0e04 /source/blender/windowmanager/intern | |
parent | 445274fc4fd8d563de585c27711f8385ce4174be (diff) |
Implement grouped undo option for operators
This option makes an operator to not push a task to the undo stack if the previous stored elemen is the same operator or part of the same undo group.
The main usage is for animation, so you can change frames to inspect the
poses, and revert the previous pose without having to roll back tons of
"change frame" operator, or even see the undo stack full.
This complements rB13ee9b8e
Design with help by Sergey Sharybin.
Reviewers: sergey, mont29
Reviewed By: mont29, sergey
Subscribers: pyc0d3r, hjalti, Severin, lowercase, brecht, monio, aligorith, hadrien, jbakker
Differential Revision: https://developer.blender.org/D2330
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index dc34e8015c9..ad8a67027c0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -730,6 +730,8 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat) if (wm->op_undo_depth == 0) if (op->type->flag & OPTYPE_UNDO) ED_undo_push_op(C, op); + else if (op->type->flag & OPTYPE_UNDO_GROUPED) + ED_undo_grouped_push_op(C, op); if (repeat == 0) { if (G.debug & G_DEBUG_WM) { @@ -1857,6 +1859,8 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) if (handler->op->type->flag & OPTYPE_UNDO) ED_undo_push_op(C, handler->op); + else if (handler->op->type->flag & OPTYPE_UNDO_GROUPED) + ED_undo_grouped_push_op(C, handler->op); if (handler->op->reports->list.first) { |