1
$\begingroup$

Pressing [T] in the Graph Editor with an Active Keyframe lets you Set Keyframe Interpolation - Dynamic Effects: Elastic, is a choice. With that choice come basic presets, .8 Amplitude, 4.100 Period

I want to do this 59 times and seem to have to do this by hand (!!!) but wouldn't complain IF I could adjust the preset so each new occurrence is right for my project. This is easy to understand in practice but tough to explain but can I adjust the presets? Copy/Paste includes the Interpolation but ALSO the keyframe value.

I'd settle for the ability to copy/paste just the adjusted Interpolation settings, can we?

enter image description here

59 times I needed .8 to become .04 - lots of clicks unless you know something I don't.

$\endgroup$
3
$\begingroup$

The first tip is that pressing T will apply the interpolation to every selected keyframe.

First, to simplify the graph editor, hide curves you aren't working on.

show fcurve option

It would appear that you want to do this to every third keyframe, so select all won't help. We have the common selection options in the graph editor.

  • B to box select keyframes
  • C to circle select keyframes
  • ⎈ CtrlRMB RMB to draw a lasso around keyframes to select

I'm thinking if you zoom out enough to see all or most of your keyframes, you can use circle select to quickly select the keys at each "corner" of your stepped fcurve.

That is about where blenders UI stops being helpful. Then we can often turn to python to help automate repetitive tasks like this. We can use the text editor to type and run longer scripts. For smaller tasks, the python console can be used to type out commands. Pressing ↑ Up arrow can bring back the previous command so we can change a single value (like the index number of the keyframe point) before repeating.

If you have selected the keys that you want and used T to set the interpolation to elestic, we can set the amplitude and period of these keys -

import bpy

obj = bpy.context.object
fc = obj.animation_data.action.fcurves

for c in fc:
    for k in c.keyframe_points:
        if k.interpolation == 'ELASTIC':
            k.amplitude = 0.8
            k.period = 4.1

In your example you appear to be setting every third keyframe, you may need to add some extra keys to maintain the repetitiveness as at least one appears missing. We can use a repetitive sequence like this to automate the entire process.

import bpy

obj = bpy.context.object
fc = obj.animation_data.action.fcurves

# adjust this to 1 or 2 to get the right keys
startidx = 0
for c in fc:
    if c.hide: continue # skip curves we have hidden
    for i in range(startidx, len(c.keyframe_points), 3):
        c.keyframe_points[i].interpolation = 'ELASTIC'
        c.keyframe_points[i].amplitude = 0.8
        c.keyframe_points[i].period = 4.1

You may also run the script and then select the first and last keys to undo the elastic setting if you didn't want it over the entire curve.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.