diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-19 11:43:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-19 11:43:12 +0300 |
commit | 7fe81fe5a320d9a4945a599ac4cb5af05f0b64e5 (patch) | |
tree | a42becb603bc7f61563e477cc4cb5c026b6f6e9e /source/blender/editors/animation/keyframing.c | |
parent | 5f140e61c28c27ce5b065620c0e94cd4a41e7c7f (diff) |
Fix T63090: Delete keyframe reports invalid for multiple objects
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index cab821e52ef..2e7ed7eae34 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -2249,10 +2249,16 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); float cfra = (float)CFRA; + int selected_objects_len = 0; + int selected_objects_success_len = 0; + int success_multi = 0; + CTX_DATA_BEGIN (C, Object *, ob, selected_objects) { ID *id = &ob->id; int success = 0; + selected_objects_len += 1; + /* just those in active action... */ if ((ob->adt) && (ob->adt->action)) { AnimData *adt = ob->adt; @@ -2317,22 +2323,29 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&ob->adt->action->id, ID_RECALC_ANIMATION_NO_FLUSH); } - /* report success (or failure) */ + /* Only for reporting. */ if (success) { - BKE_reportf(op->reports, - RPT_INFO, - "Object '%s' successfully had %d keyframes removed", - id->name + 2, - success); - } - else { - BKE_reportf(op->reports, RPT_ERROR, "No keyframes removed from Object '%s'", id->name + 2); + selected_objects_success_len += 1; + success_multi += success; } DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); } CTX_DATA_END; + /* 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); + } + else { + 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); |