Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyframing.c
| Context not available. | |||||
| * it is more useful for animators working in the 3D view. | * 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) | CTX_DATA_BEGIN (C, Object *, ob, selected_objects) | ||||
| { | { | ||||
| /* just those in active action... */ | /* just those in active action... */ | ||||
| Context not available. | |||||
| /* delete F-Curve completely */ | /* delete F-Curve completely */ | ||||
| if (can_delete) { | if (can_delete) { | ||||
| ANIM_fcurve_delete_from_animdata(NULL, adt, fcu); | ANIM_fcurve_delete_from_animdata(NULL, adt, fcu); | ||||
| num_removed++; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
brecht: There should only be one info message for the operator I think, not one for each object. As… | |||||
| /* update... */ | /* update... */ | ||||
| DAG_id_tag_update(&ob->id, OB_RECALC_OB); | DAG_id_tag_update(&ob->id, OB_RECALC_OB); | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| if (num_removed > 0) | |||||
| BKE_reportf(op->reports, RPT_INFO, "Deleted %d animation f-curves from selected objects", num_removed); | |||||
Not Done Inline ActionsThe correct message would be: "Deleted %d animation f-curves from selected objects.", as you aren't counting the objects here. brecht: The correct message would be: "Deleted %d animation f-curves from selected objects.", as you… | |||||
| /* send updates */ | /* send updates */ | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL); | WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, NULL); | ||||
| Context not available. | |||||
| ot->idname = "ANIM_OT_keyframe_clear_v3d"; | ot->idname = "ANIM_OT_keyframe_clear_v3d"; | ||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->invoke = WM_operator_confirm; | |||||
| ot->exec = clear_anim_v3d_exec; | ot->exec = clear_anim_v3d_exec; | ||||
| ot->poll = ED_operator_areaactive; | ot->poll = ED_operator_areaactive; | ||||
| Context not available. | |||||
| ot->idname = "ANIM_OT_keyframe_delete_v3d"; | ot->idname = "ANIM_OT_keyframe_delete_v3d"; | ||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->invoke = WM_operator_confirm; | |||||
| ot->exec = delete_key_v3d_exec; | ot->exec = delete_key_v3d_exec; | ||||
| ot->poll = ED_operator_areaactive; | ot->poll = ED_operator_areaactive; | ||||
| Context not available. | |||||
There should only be one info message for the operator I think, not one for each object. As only one message is shown at the time, it would only show one object as modified and that's misleading, so better don't show objects names at all, but rather something like "Keyframes removed from %d objects".
The other things is that this should check that some fcurve was in fact removed for this object.