Snap Keyframe to Slider

Snap selected keyframe to time Slider position

Snap the end or top of the selected keyframe.

Download

Keymap

Dopesheet / Graph Editor

  • Ctrl + Alt + Left Mouse Drag ← …… Snap First
  • Ctrl + Alt + Left Mouse Drag → …… Snap End

Other

I wanted a keyframe operation that can be snapped easily like After Effects, so I made a small add-on.

(It may be possible with only the standard functions of Blender… But, I couldn’t find it.)

Construction

  1. Make a list of selection keyframe positions
  2. Get minimum / maximum position of list
  3. Subtract the difference between the minimum / maximum
  4. position and the time slider position (current frame)

Known bugs

!! There is a bug that unselected keyframes may move.
It seems to occur when you execute add-on functions after duplicating keyframes.

3 Likes

Thanks for this simple but brilliant idea.

Hi, I just got the add-on from Gumroad as it would be useful in my current project.
Well, unfortunately, I have a major issue - or am I doing something wrong? Using the graph editor, doing a box selection, the plug-in only moves the keyframes, not the handles. The same happens, when using the dope sheet. There it looks fine as you can’t see the bezier handles, but using the graph editor, you can see, that the handles do not move along. Tried in 2.83 and 2.82.
Thanks.
SK2S-1_before SK2S-2_after

1 Like

I didn’t notice … I’m sorry.
I try fix this deadly bug.
I will refund you if it is difficult to fix the bug.

Thanks, hopefully you can fix it. :crossed_fingers:

ver1.1.0 Update

Fixed a bug that the handle could not be moved

Fixed a fatal bug.

1 Like

Added “snap_keyframe_to_slider_ver1-1-0.py” file with bug fixes to gumroad.
please confirm.

Woohoo, looking good - it works as expected now - thanks for the quick fix! :pray:

1 Like

Hm, I moved some more keyframes around and encountered some strange behaviour. With a rig, after duplicating a range of keyframes and trying to align that set, some unselected keyframes moved as well. Also, playing with a simple scene with two cubes and shifting a couple of keyframes back and forth within the graph editor, like 4 to 5 times to the left and to the right, at some point the handles get messed up unfortunately. Don’t know, if you can replicate this behaviour and if it is possible to fix. Thanks

ver1.1.1 Fixed a problem that the handle was slightly shifted

  • Fixed a problem that the handle was slightly shifted
  • Supported channel lock setting
    • Keyframes on locked channels are excluded from operation, even if they are selected

It my approach was wrong.
This problem has been fixed in the “snap_keyframe_to_slider_ver1-1-1” file.
It should work this time.:pray:

1 Like

Sounds good. Will test and confirm tomorrow, when I am back at my work station. Thanks for the quick support! :+1:

Yes, the handles seem to work fine now! Thanks.

Another thing: I was expecting the add-on would only shift the selected keys, but atm it also shifts the later keyframes as well, even if they are not selected.

I still got the weird issue with a character rig. Attached some screenshots. I don’t know, what causes this.
1: selected set of keyframes
2+3: just shifting them via the add-on works fine
4: duplicated the set of keyframes
5: trying to shift the duplicated set to the slider, but some keys from the left get affected as well, causing them and the set being shifted to the right - very odd
rig_issue.zip (584.1 KB)

I tried to reproduce this problem, but could not reproduce it in my environment.
Can I send more information or Blend files when a problem occurs?

If you do not want to publish the file on the net, you can also receive it by email.
[email protected]

Tried it two more times. The first time I had the shifting of the later keys issue again and thought it was related to rotation keyframes. Tried it again and then it worked. Have to save the file right away, when it happens again.
Sending you now the character rig via e-mail as it is a commercial rig. That issue as shown in the zipped screenshots keeps occuring. Thanks.

1 Like

thank you for your cooperation.
The received file is used for bug fixing only.

I was able to find bugs in this file.
Let’s examine it in detail.

1 Like

I tried to clarify this problem but could not solve it.
This is a fatal problem that cannot guarantee the reliability of operation.
We have refunded the buyer who made the payment.
Sorry for not meeting expectations …

(It seems that the property “select_control_point” which gets the selection point of the keyframe sometimes gets the non-selection point.
I don’t know the law of getting non-selection)

Thanks for trying to solve the issue and the refund for now. I still like the idea of the add-on and it’s fast and intuitive workflow. Maybe you find a solution / a work around in the future. Thanks for your continuous contribution to the Blender community!