From fdf34666f00fc0995507b46e30a0e732812cd05e Mon Sep 17 00:00:00 2001 From: Amelie Fondevilla Date: Tue, 2 Aug 2022 12:24:30 +0200 Subject: Fix Unreported : add F-curves only filter to functions only appliable to F-curves channels. The filter was missing in some places that are using channel data as if it was f-curve channel. There seems to be no related issue or bug, but still it would be best to have them there. Reviewed By: sybren Differential Revision: http://developer.blender.org/D15505 --- source/blender/editors/animation/anim_channels_edit.c | 10 ++++++---- source/blender/editors/animation/keyframes_edit.c | 4 ++-- source/blender/editors/animation/keyframes_keylist.cc | 7 ++++--- source/blender/editors/include/ED_anim_api.h | 1 + source/blender/editors/space_graph/space_graph.c | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index f371591c3a8..1c7b3496723 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1640,7 +1640,8 @@ static void animchannels_group_channels(bAnimContext *ac, int filter; /* find selected F-Curves to re-group */ - filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL); + filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | + ANIMFILTER_FCURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, adt_ref, ANIMCONT_CHANNEL); if (anim_data.first) { @@ -1754,7 +1755,7 @@ static int animchannels_ungroup_exec(bContext *C, wmOperator *UNUSED(op)) /* just selected F-Curves... */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | - ANIMFILTER_NODUPLIS); + ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); for (ale = anim_data.first; ale; ale = ale->next) { @@ -2454,7 +2455,7 @@ static int animchannels_enable_exec(bContext *C, wmOperator *UNUSED(op)) } /* filter data */ - filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS); + filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* loop through filtered data and clean curves */ @@ -3454,7 +3455,8 @@ static bool select_anim_channel_keys(bAnimContext *ac, int channel_index, bool e /* get the channel that was clicked on */ /* filter channels */ - filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS); + filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | + ANIMFILTER_FCURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* get channel from index */ diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 706db498a82..63bd5665459 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -218,7 +218,7 @@ static short ob_keyframes_loop(KeyframeEditData *ked, ac.datatype = ANIMCONT_CHANNEL; /* get F-Curves to take keyframes from */ - filter = ANIMFILTER_DATA_VISIBLE; /* curves only */ + filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FCURVESONLY; ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* Loop through each F-Curve, applying the operation as required, @@ -267,7 +267,7 @@ static short scene_keyframes_loop(KeyframeEditData *ked, ac.datatype = ANIMCONT_CHANNEL; /* get F-Curves to take keyframes from */ - filter = ANIMFILTER_DATA_VISIBLE; /* curves only */ + filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FCURVESONLY; ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* Loop through each F-Curve, applying the operation as required, diff --git a/source/blender/editors/animation/keyframes_keylist.cc b/source/blender/editors/animation/keyframes_keylist.cc index 8dc598e6e2d..da266dd4253 100644 --- a/source/blender/editors/animation/keyframes_keylist.cc +++ b/source/blender/editors/animation/keyframes_keylist.cc @@ -943,7 +943,8 @@ void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, const i ac.datatype = ANIMCONT_CHANNEL; /* get F-Curves to take keyframes from */ - const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE; /* curves only */ + const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FCURVESONLY; + ANIM_animdata_filter( &ac, &anim_data, filter, ac.data, static_cast(ac.datatype)); @@ -980,7 +981,7 @@ void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, const int ac.datatype = ANIMCONT_CHANNEL; /* get F-Curves to take keyframes from */ - const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE; /* curves only */ + const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FCURVESONLY; ANIM_animdata_filter( &ac, &anim_data, filter, ac.data, static_cast(ac.datatype)); @@ -1015,7 +1016,7 @@ void cachefile_to_keylist(bDopeSheet *ads, /* get F-Curves to take keyframes from */ ListBase anim_data = {nullptr, nullptr}; - const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE; /* curves only */ + const eAnimFilter_Flags filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_FCURVESONLY; ANIM_animdata_filter( &ac, &anim_data, filter, ac.data, static_cast(ac.datatype)); diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index cc3c68abc55..ee87de5774a 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -334,6 +334,7 @@ typedef enum eAnimFilter_Flags { ANIMFILTER_TMP_IGNORE_ONLYSEL = (1u << 31), } eAnimFilter_Flags; +ENUM_OPERATORS(eAnimFilter_Flags, ANIMFILTER_TMP_IGNORE_ONLYSEL); /** \} */ diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 3dd21fd22c6..ea2e2e44b90 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -625,7 +625,7 @@ static void graph_refresh_fcurve_colors(const bContext *C) * - we don't include ANIMFILTER_CURVEVISIBLE filter, as that will result in a * mismatch between channel-colors and the drawn curves */ - filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS); + filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); items = ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* loop over F-Curves, assigning colors */ -- cgit v1.2.3