diff options
Diffstat (limited to 'source/blender/editors/space_action/action_edit.c')
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 90c38426164..a28b4c1a4f2 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -898,7 +898,7 @@ void ACTION_OT_delete(wmOperatorType *ot) /* ******************** Clean Keyframes Operator ************************* */ -static void clean_action_keys(bAnimContext *ac, float thresh) +static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -910,7 +910,7 @@ static void clean_action_keys(bAnimContext *ac, float thresh) /* loop through filtered data and clean curves */ for (ale = anim_data.first; ale; ale = ale->next) { - clean_fcurve((FCurve *)ale->key_data, thresh); + clean_fcurve(ac, ale, thresh, clean_chan); ale->update |= ANIM_UPDATE_DEFAULT; } @@ -925,6 +925,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op) { bAnimContext ac; float thresh; + bool clean_chan; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -937,9 +938,10 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op) /* get cleaning threshold */ thresh = RNA_float_get(op->ptr, "threshold"); + clean_chan = RNA_boolean_get(op->ptr, "channels"); /* clean keyframes */ - clean_action_keys(&ac, thresh); + clean_action_keys(&ac, thresh, clean_chan); /* set notifier that keyframes have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); @@ -964,6 +966,7 @@ void ACTION_OT_clean(wmOperatorType *ot) /* properties */ ot->prop = RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f); + RNA_def_boolean(ot->srna, "channels", false, "Channels", ""); } /* ******************** Sample Keyframes Operator *********************** */ |