Fix T103303: Dbl-click in the Graph Editor wont select all keyframes

This was the case when an Annotation is also present as in the report.

Since {rB92d7f9ac56e0}, Dopesheet is aware of greaspencil/annotations
(displays its channels/keyframes, can rename their data, layers, fcurve
groupings etc.). However, the Graph Editor does not display these /
should not be aware of them.

Above commit already had issues that were addressed in the following
commits (mostly adding the new `ANIMFILTER_FCURVESONLY` to places that
dont handle greasepencil/annotations)
- {rBfdf34666f00f}
- {rB45f483681fef}
- {rBa26038ff3851}

Now in T103303 it was reported that doublicking a channel would not
select all fcurve`s keyframes anymore and this wasnt actually an issue
with that particular operator, but instead with another operator that is
also mapped to doubleclicking: the channel renaming (I assume the
keyconflict here is actually wanted behavior).
Channel renaming would not return `OPERATOR_PASS_THROUGH` here anymore
in the case nothing cannot be renamed, so we would not actually reach
the 2nd operator at all (the one selecting all keyframes).
Deeper reason for this is that the renaming operator would actually
"see" a channel that could be renamed (in the case of the report: an
annotation layer), but then cannot proceed, because the "real"
underlying data where the doubleclick happens is an fcurve...

So now exclude non-greasepencil channels in filtering as well where
appropriate by also adding `ANIMFILTER_FCURVESONLY` to the filter there.

Fixes T103303.

Maniphest Tasks: T103303

Differential Revision: https://developer.blender.org/D16871
This commit is contained in:
Philipp Oeser 2022-12-23 16:08:25 +01:00
parent 2a5104e368
commit d1810d11f4
Notes: blender-bot 2023-02-13 13:46:06 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #103303, Doubleclicking a channel in the Graph Editor wont select all keyframes (when an Annotation is also present)
1 changed files with 6 additions and 3 deletions

View File

@ -2845,12 +2845,15 @@ static bool rename_anim_channels(bAnimContext *ac, int channel_index)
int filter;
bool success = false;
/* get the channel that was clicked on */
/* filter channels */
/* Filter relevant channels (note that greasepencil/annotations are not displayed in Graph
* Editor). */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
if (ELEM(ac->datatype, ANIMCONT_FCURVES, ANIMCONT_NLA)) {
filter |= ANIMFILTER_FCURVESONLY;
}
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get channel from index */
/* Get channel that was clicked on from index. */
ale = BLI_findlink(&anim_data, channel_index);
if (ale == NULL) {
/* channel not found */