Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-20 04:38:07 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-20 04:40:33 +0400
commitb2fdc591c36cf5125eaa528b7f735c3c4393d390 (patch)
tree8f0525ef93d8336a373810b821155bf04995f0bd /source/blender/editors/animation
parent29e3b098253270d4c5cf8337ad068bf4e98d7bdb (diff)
UI: restore confirmation popups for delete operators.
It turned out this was leading to accidental deleting in some cases when the info message was missed by users. Fixes T37801.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframing.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 968a3ff15ad..1b77c1530bf 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1514,9 +1514,9 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot)
* it is more useful for animators working in the 3D view.
*/
-static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
+static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
{
- int num_deleted = 0;
+ bool changed = false;
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
@@ -1557,18 +1557,17 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
/* delete F-Curve completely */
if (can_delete) {
ANIM_fcurve_delete_from_animdata(NULL, adt, fcu);
- num_deleted++;
+ DAG_id_tag_update(&ob->id, OB_RECALC_OB);
+ changed = true;
}
}
}
-
- /* update... */
- DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
CTX_DATA_END;
- if (num_deleted > 0)
- BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation F-Curves from selected objects", num_deleted);
+ if (!changed) {
+ return OPERATOR_CANCELLED;
+ }
/* send updates */
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
@@ -1584,6 +1583,7 @@ void ANIM_OT_keyframe_clear_v3d(wmOperatorType *ot)
ot->idname = "ANIM_OT_keyframe_clear_v3d";
/* callbacks */
+ ot->invoke = WM_operator_confirm;
ot->exec = clear_anim_v3d_exec;
ot->poll = ED_operator_areaactive;
@@ -1647,6 +1647,7 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot)
ot->idname = "ANIM_OT_keyframe_delete_v3d";
/* callbacks */
+ ot->invoke = WM_operator_confirm;
ot->exec = delete_key_v3d_exec;
ot->poll = ED_operator_areaactive;