FCurve selection state is confusing

I am unsure whether this is a more of a feedback or a contribution topic.
As I stumbled upon it while trying to build an addon to clean mocap data I decided to post this here.

The selection state of FCurves and Keyframes is really confusing.
The visibility and selection state of Keyframes and FCurves is depending on the selection/active state of its assigned bones, the active/selection state of their armature and blenders mode.

Some of these combinations lead to unexpected results:

1. FCurves are not shown when armature is not highlighted in outliner

When selecting bones via Box selection (in Pose Mode) I can select one or multiple bones without having an active bone.
When doing so the curves of the bones are shown in graph view but the left part with the names and settings for the fcurves is empty.
image

I need to actually highlight the armature in the outliner for the curve info to get shown.
When clicking on a single bone to set it active Blender automatically highlights the armature in the outliner and the curve info is visible.

Why is it even possible to show the curves without displaying the info and why is this dependent on the outliner highlight (selected?) state and not on the active armature?

2. Selecting Keyframes without selecting their FCurves

Some Graph View selection operators automatically select their corresponding FCurves (in the info panel on the left) like the Box selection but others do not.
For example using Column Selection the Keyframes get selected while the FCruves do not.

As for example selected_editable_keyframes only returns keyframes of FCurves that are also selected this leads to a really confusing selection state.

If a user selects keyframes on a single curve and extends the selection to multiple curves view column selection before running an operator the User would expect the operator to run on all keyframes.

I could not find a way to access the selected Keyframes of an unselected FCurve in python.
My current workaround is to automatically select all visible FCurves before invoking my custom operator:

def execute(self, context): 
        for fcurve in context.visible_fcurves:
            fcurve.select = True

Internal blender operator seem to get the selected Keyframes just fine though. As an example I can easily delete all selected Keyframes regardless of their FCurves’ selection state.

Why do the FCurves even have an independent selection state?
I cannot think of a use case where you would want to select Keyframes without “selecting” its FCurve.
And why does it change the content of selected_editable_keyframes as the Keyframes are clearly selected and editable even when the FCruve isnt selected?

Thanks,
Pascal

2 Likes

@sybren points for the next animation module meeting, maybe?

This is expected. In Blender ‘selected’ and ‘active’ are not tightly coupled.

When doing so the curves of the bones are shown in graph view but the left part with the names and settings for the fcurves is empty.

Please report this as a bug, with exact steps to reproduce the issue. It’s probably due to the list of bones scrolling

Some Graph View selection operators automatically select their corresponding FCurves (in the info panel on the left) like the Box selection but others do not.
For example using Column Selection the Keyframes get selected while the FCruves do not.

As for example selected_editable_keyframes only returns keyframes of FCurves that are also selected this leads to a really confusing selection state.

Please file a bug report about this too.

Why do the FCurves even have an independent selection state?

Because operations like “delete selected F-Curves” work on the selected F-Curves, regardless of their key selection state. It’s analogous to mesh object selection being decoupled from vertex selection.

The pressure is on to finish Project Baklava Phase 1, so there’s little chance this will actually be addressed any time soon. It’ll probably be taken into account when working on the new animation layers, but there’s much other work to do before that.

2 Likes

Thank your for the detailed explanation.

I tried to reproduce the bug where the channels are not being displayed but I figured that it seems impossible to get into this state only using the user interface as you can only enter pose mode when an armature is active and entering pose mode will automatically set the first bone active.
Even using python I could not build a simple repro case yet.
It somehow happens to end up in this state during our importer which switches active/selected objects and modes multiple times.
I did not create a bug report for this yet but will do so as soon as I can build a repro case.

For the inconsistent channel selection I filed a bug report here: #125610 - Inconsistent channel selection when selecting keyframes - blender - Blender Projects

That makes sense. But turning it around: Is there any use case where the channel should not be selected although a keyframe on this channel is selected or shouldn’t selecting a key always select its corresponding channel?

Looking forward to the animation updates btw. :slightly_smiling_face:

The state of the current animation channel code (for selection handling, display in the channel list, filtering, etc.) is such that it’s very hard to modify things there. When we start working on layered animation, this will have to be rebuilt from the ground up. Making things more sensible is definitely a goal, both on the code and the UI/UX side.

4 Likes