[Bf-blender-cvs] [d1810d11f42] master: Fix T103303: Dbl-click in the Graph Editor wont select all keyframes

Philipp Oeser noreply at git.blender.org
Thu Jan 5 16:13:46 CET 2023


Commit: d1810d11f425345f455385312c61594f425e257a
Author: Philipp Oeser
Date:   Fri Dec 23 16:08:25 2022 +0100
Branches: master
https://developer.blender.org/rBd1810d11f425345f455385312c61594f425e257a

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

===================================================================

M	source/blender/editors/animation/anim_channels_edit.c

===================================================================

diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index a83266c484e..c612ab10d65 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -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 */



More information about the Bf-blender-cvs mailing list