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:
authorEmanuel Claesson <emanuel.claesson@gmail.com>2013-11-25 07:55:26 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-11-25 15:21:45 +0400
commit3ca4387bc80b17d945d3ced2f55fd2ae6d962b1b (patch)
tree18e50d21863c51a95067176513d225fc0ee802a7 /source/blender/editors/animation
parent20769605593e6f850d30169175a01757f3e0fbb6 (diff)
UI: remove unnecessary confirmation popups
This makes a number of operators no longer ask for confirmation, rather it will show an info message after performing the operation. Ref T37422 for decision. In particular, these were changed: * Delete objects, bones, keyframes, masks, mask curves, motion tracks, markers. * Clear and delete keyframes in the 3D view. * Align bone to parents. * Separate bones from armature. * Group/ungroup metastrips in sequencer. * Copy/paste objects to/from buffer. Reviewed By: brecht, dingto Differential Revision: http://developer.blender.org/D35
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframes_general.c8
-rw-r--r--source/blender/editors/animation/keyframing.c14
2 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index cfa5f9f032c..15abdb452ce 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -104,12 +104,13 @@ void delete_fcurve_key(FCurve *fcu, int index, short do_recalc)
}
/* Delete selected keyframes in given F-Curve */
-void delete_fcurve_keys(FCurve *fcu)
+bool delete_fcurve_keys(FCurve *fcu)
{
int i;
+ bool modified = false;
if (fcu->bezt == NULL) /* ignore baked curves */
- return;
+ return false;
/* Delete selected BezTriples */
for (i = 0; i < fcu->totvert; i++) {
@@ -117,12 +118,15 @@ void delete_fcurve_keys(FCurve *fcu)
memmove(&fcu->bezt[i], &fcu->bezt[i + 1], sizeof(BezTriple) * (fcu->totvert - i - 1));
fcu->totvert--;
i--;
+ modified = true;
}
}
/* Free the array of BezTriples if there are not keyframes */
if (fcu->totvert == 0)
clear_fcurve_keys(fcu);
+
+ return modified;
}
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 1028fb30ba4..70a3985c266 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1474,8 +1474,10 @@ 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 *UNUSED(op))
+static int clear_anim_v3d_exec(bContext *C, wmOperator *op)
{
+ int num_removed = 0;
+
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
/* just those in active action... */
@@ -1515,15 +1517,19 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
/* delete F-Curve completely */
if (can_delete) {
ANIM_fcurve_delete_from_animdata(NULL, adt, fcu);
+ num_removed++;
}
}
}
-
+
/* update... */
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
CTX_DATA_END;
-
+
+ if (num_removed > 0)
+ BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation f-curves from selected objects", num_removed);
+
/* send updates */
WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
@@ -1538,7 +1544,6 @@ 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;
@@ -1602,7 +1607,6 @@ 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;