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:
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 8dc4aed9f0e..1ef7ee755ea 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -2107,10 +2107,12 @@ static int delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *k
return OPERATOR_CANCELLED;
}
+ PropertyRNA *prop = RNA_struct_find_property(op->ptr, "confirm_success");
+ bool confirm = (prop != NULL && RNA_property_boolean_get(op->ptr, prop));
+
if (num_channels > 0) {
/* if the appropriate properties have been set, make a note that we've inserted something */
- PropertyRNA *prop = RNA_struct_find_property(op->ptr, "confirm_success");
- if (prop != NULL && RNA_property_boolean_get(op->ptr, prop)) {
+ if (confirm) {
BKE_reportf(op->reports,
RPT_INFO,
"Successfully removed %d keyframes for keying set '%s'",
@@ -2121,7 +2123,7 @@ static int delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *k
/* send notifiers that keyframes have been changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_REMOVED, NULL);
}
- else {
+ else if (confirm) {
BKE_report(op->reports, RPT_WARNING, "Keying set failed to remove any keyframes");
}
@@ -2289,6 +2291,8 @@ static int delete_key_v3d_without_keying_set(bContext *C, wmOperator *op)
int selected_objects_success_len = 0;
int success_multi = 0;
+ bool confirm = op->flag & OP_IS_INVOKE;
+
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
ID *id = &ob->id;
int success = 0;
@@ -2370,20 +2374,20 @@ static int delete_key_v3d_without_keying_set(bContext *C, wmOperator *op)
/* report success (or failure) */
if (selected_objects_success_len) {
- BKE_reportf(op->reports,
- RPT_INFO,
- "%d object(s) successfully had %d keyframes removed",
- selected_objects_success_len,
- success_multi);
+ if (confirm) {
+ BKE_reportf(op->reports,
+ RPT_INFO,
+ "%d object(s) successfully had %d keyframes removed",
+ selected_objects_success_len,
+ success_multi);
+ }
+ /* send updates */
+ WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
}
- else {
+ else if (confirm) {
BKE_reportf(
op->reports, RPT_ERROR, "No keyframes removed from %d object(s)", selected_objects_len);
}
-
- /* send updates */
- WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL);
-
return OPERATOR_FINISHED;
}