Page MenuHome

"Clean Keyframes" in Dope Sheet only works if channels are selected
Needs Information from Developers, NormalPublic

Description

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Radeon RX 580 Series ATI Technologies Inc. 4.5.13596 Core Profile Context 20.10.35.02 27.20.1034.6

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-04-02 21:26, hash: rB321eef6a0c0f
Worked: unknown

Short description of error
The "Clean Keyframes" and "Clean Channels" operators in the Dope Sheet editor only work if the channels containing the selected keyframes are also selected. This is unlike the "Delete Keyframes" operator, which works even if the channels are not selected.

Exact steps for others to reproduce the error

  • Load the default startup scene.
  • Enable Auto Keying in the Timeline editor.
  • Move the cube up a bit.
  • Seek the playhead to another frame and move the cube up a bit more.
  • Switch to the Animation workspace.
  • In the Dope Sheet editor, click in an empty space of the keyframe region to deselect all keyframes and channels.
  • Expand the "Object Transforms" channel group and, with the mouse cursor in the keyframe region, press A to select all keyframes (but not the channels).
  • Press X and select "Delete Keyframes." All keyframes and channels are deleted as expected. Press Ctrl-Z to revert.
  • Press X again, but this time select "Clean Keyframes." Nothing happens despite there being plenty of keyframes to clean.
  • Move the mouse cursor to the channel region and press A to select all channels.
  • Move the mouse cursor back to the keyframe region and run "Clean Keyframes" again. This time, the cleanup works as expected.

The "Clean Channels" operator behaves in the same way.

The reason this only happens in the Dope Sheet editor and not the Graph Editor is likely that the Graph Editor automatically selects the channels for the selected keyframes, but the Dope Sheet editor does not. (It's not limited to "Select All", either; if you box-select keyframes from multiple channels, the same difference is observed.)

So rather than making "Clean Keyframes" and "Clean Channels" independent of channel selection, the real fix might be to automatically select the relevant channels in the Dope Sheet editor too.

Apart from this, it might make sense to move the "Clean Channels" operator to the "Channel" menu (and the "X" button of the channel region) and make it depend on channel selection *only* - that is, clean all keyframes of the selected channels, even if there are no keyframes selected. That way, there'd be some nice symmetry between the "Channel" and "Key" menus, both having their own "Delete" and "Clean" operators.

Event Timeline

Matthew Hinson (arc_) renamed this task from "Clean Keyframes" in Dope Sheet requires (manual) channel selection to "Clean Keyframes" in Dope Sheet only works if channels are selected.Sat, Apr 3, 12:15 PM
Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Needs Information from Developers.Wed, Apr 7, 7:32 PM

I'm not sure if this is not the expected behavior, but the name is really confusing, "Clean Channels" is behaving as if the name was Delete Selected Channels.
Someone from the Animation & Rigging team can better understand what's going on.

The difference between "Clean Channels" and "Delete Channels" is that "Clean" only deletes channels that contain no useful information (namely, channels whose keyframes all have the same value). In the example above, "Delete" deletes all the channels, but "Clean" leaves behind the "Z Location" channel. So in that sense, I wouldn't say "Clean Channels" is a bad name - at most, it could maybe be moved from the "Key" menu to the "Channel" menu, and be made to work with the selected channels rather than the selected keys.