Page MenuHome

[WIP/eperimental] Graph Editor: support snapping handles
Needs ReviewPublic

Authored by Philipp Oeser (lichtwerk) on Dec 17 2021, 10:11 AM.
Tokens
"Like" token, awarded by Juangra_Membata."Like" token, awarded by sanek2005."Pterodactyl" token, awarded by Gavriel5578."Love" token, awarded by blastframe.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Maniphest Tasks
T94174: Graph Editor 'Selected Keyframes' Panel
Summary

This came up in a recent Animation & Rigging meeting.
Previously only keyframes themselves were supported in Graph Editor
snapping, now suport this for handles as well.

As an example, only the Selection to Current Frame is supported here
to gather feedback.

  • only keyframe is selected: just the keyframe moves in time (both handles stay exactly [absolute] where they are)
  • only handle is selected: just the handle gets snapped, the keyframe stays exactly [absolute] where it is
  • one handle plus keyframe selected: the keyframe gets snapped, the selected handle keeps it relative offset, the unselected handle stays exactly where it is
  • both handles plus keyframe selected : keyframe gets snapped, both handles keep their relative distance (just is most like the transform system

(atm - current master - only the keyframe snaps, the handles always stay exactly where they are)

ref T94174

Diff Detail

Repository
rB Blender
Branch
T94174_a (branched from master)
Build Status
Buildable 20001
Build 20001: arc lint + arc unit

Event Timeline

This was discussed in the Animation & Rigging module meeting, and the module members approved of this idea.

@bassam kurdali (bassamk) said: Check what happens if both handles and keys themselves are selected. That should move the key and keep the handles as they are. This is not what 3D Curve objects do -- they snap handles and points themselves.

This was discussed in the Animation & Rigging module meeting, and the module members approved of this idea.

@bassam kurdali (bassamk) said: Check what happens if both handles and keys themselves are selected. That should move the key and keep the handles as they are. This is not what 3D Curve objects do -- they snap handles and points themselves.

OKi, will complete it then

@bassam kurdali (bassamk) said: Check what happens if both handles and keys themselves are selected. That should move the key and keep the handles as they are. This is not what 3D Curve objects do -- they snap handles and points themselves.

After looking at it again, it is not entirely clear what "move the key and keep the handles as they are" really means if both handles and the keyframe itself are selected.
In all of the following, I also assume we should only really care about FREE and ALIGNED handles (since for the other modes handles would update in the background anyways).
Also: what happens if left handle and keyframe are selected (but not the right handle).
The transform system will keep the offset from the keyframe to the handle as soon as the keyframe is selected.
Of course we could just do the same for snapping (would be consistent).
However we loose the flexibility of keeping handles exactly in place and only snap the keyframe itself (not being an animator, I am a bit unsure how useful this really is though).

So for maximum flexibility, I'll update the patch with the following behavior:

  • only keyframe is selected: just the keyframe moves in time (both handles stay exactly [absolute] where they are)
  • only handle is selected: just the handle gets snapped, the keyframe stays exactly [absolute] where it is
  • one handle plus keyframe selected: the keyframe gets snapped, the selected handle keeps it relative offset, the unselected handle stays exactly where it is
  • both handles plus keyframe selected : keyframe gets snapped, both handles keep their relative distance (just is most like the transform system

(atm - current master - only the keyframe snaps, the handles always stay exactly where they are)

@bassam kurdali (bassamk) , @Kevin C. Burke (blastframe) , @Sybren A. Stüvel (sybren) : is this how you would expect it to work?

  • only keyframe is selected: just the keyframe moves in time (both handles stay exactly [absolute] where they are)
  • only handle is selected: just the handle gets snapped, the keyframe stays exactly [absolute] where it is
  • one handle plus keyframe selected: the keyframe gets snapped, the selected handle keeps it relative offset, the unselected handle stays exactly where it is
  • both handles plus keyframe selected : keyframe gets snapped, both handles keep their relative distance (just is most like the transform system
Philipp Oeser (lichtwerk) edited the summary of this revision. (Show Details)

One issue I just noticed: if you box select multiple keys of multiple fcurves (all handles and keyframes are then selected), then deselect the keyframes (to work on multiple handles only), snapping will only work on one curve.
(this might have to do with the active FCurve, will check shortly...)