[Bf-blender-cvs] [b2f0803b5b5] blender2.8: Fix T55511: Decorator drag makes many undo steps
Campbell Barton
noreply at git.blender.org
Mon Jun 18 08:27:32 CEST 2018
Commit: b2f0803b5b584c958ca34fbcf39bc48bc45b6fd3
Author: Campbell Barton
Date: Mon Jun 18 08:25:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb2f0803b5b584c958ca34fbcf39bc48bc45b6fd3
Fix T55511: Decorator drag makes many undo steps
Each keyframe made a separate undo step.
===================================================================
M source/blender/editors/interface/interface_anim.c
M source/blender/editors/interface/interface_layout.c
===================================================================
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 82fe32e3747..cda70d405ad 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -326,11 +326,13 @@ void ui_but_anim_paste_driver(bContext *C)
void ui_but_anim_decorate_cb(bContext *C, void *arg_but, void *UNUSED(arg_dummy))
{
+ wmWindowManager *wm = CTX_wm_manager(C);
uiBut *but = arg_but;
but = but->prev;
/* FIXME(campbell), swapping active pointer is weak. */
SWAP(struct uiHandleButtonData *, but->active, but->next->active);
+ wm->op_undo_depth++;
if (but->flag & UI_BUT_DRIVEN) {
/* pass */
@@ -354,4 +356,5 @@ void ui_but_anim_decorate_cb(bContext *C, void *arg_but, void *UNUSED(arg_dummy)
}
SWAP(struct uiHandleButtonData *, but->active, but->next->active);
+ wm->op_undo_depth--;
}
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 1ce34fec118..ff9b08a65c9 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1720,7 +1720,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
block, UI_BTYPE_BUT, 0, ICON_DOT, 0, 0, UI_UNIT_X, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Animate property"));
UI_but_func_set(but, ui_but_anim_decorate_cb, but, NULL);
- but->flag |= UI_BUT_DRAG_LOCK;
+ but->flag |= UI_BUT_UNDO | UI_BUT_DRAG_LOCK;
}
else {
/* We may show other information here in future, for now use empty space. */
More information about the Bf-blender-cvs
mailing list