Skip to main content
johnt53984649
Inspiring
September 9, 2018
Question

Easy Ease Keyframe Temporal Interpolation in AE Scripting

  • September 9, 2018
  • 3 replies
  • 5605 views

My goal is to apply several keyframes to a property of a layer and then set them all as "Easy Ease": essentially, I'm looking to achieve the exact same effect as doing the following in After Effects:

Playing keyframes, without changing their default interpolation (so leaving them as linear)

Selecting all keyframes just placed.

Pressing F9 to apply Easy Ease.

I know how to do this when using After Effects manually but not when writing scripts.  I would like to achieve the exactly same effect with After Effects scripting.  I've come close, but I'm not quite there.  For example:

master_comp.layer(1).property("Opacity").setInterpolationTypeAtKey(1, KeyframeInterpolationType.BEZIER, KeyframeInterpolationType.BEZIER);

Will change the newest pre-existing linear keyframe to Bezier, but it will not apply Easy Ease to it; they are not the same.

How can I apply Easy Ease to all the keyframes for a given property of a layer?

This topic has been closed for replies.

3 replies

johnt53984649
Inspiring
September 23, 2018

I figured it out; it turns out you need to apply all the keyframes first, and THEN apply Easy Ease to them.  I was applying a keyframe, then easy ease to the keyframe, and continuing that cycle for the rest of them.  You have to do ALL the keyframes and THEN apply all the Easy Eases, one by one to each keyframe from left to right.  That makes it work perfectly.

As you mentioned earlier, 33 is the default.  It comes out exactly right, so it is indeed 33 and not 33.33333 as you suggested.

Thank you very much!

Andrei Popa
Inspiring
September 11, 2018

var easeIn = new KeyframeEase(0.5, 50);

var easeOut = new KeyframeEase(0.75, 85);

var myPositionProperty = app.project.item(1).layer(1).property("Position")

myPositionProperty.setTemporalEaseAtKey(2, [easeIn], [easeOut]);

The default easy ease is (0,33) . More on this on page 84 in this document

johnt53984649
Inspiring
September 17, 2018

var easeIn = new KeyframeEase(0, 33);

var easeOut = new KeyframeEase(0, 33);

master_comp.layer(1).property("Scale").setTemporalEaseAtKey(1, [easeIn, easeIn, easeIn], [easeOut, easeOut, easeOut]); // key index = 1

I don't quite get the same result as Easy Ease.  Here's the graph editor screenshot for reference:

O5TZFN7.png

Can you help me figure out what I'm doing wrong?

Andrei Popa
Inspiring
September 17, 2018

johnt53984649 That very small difference is due to the numbers. Try using 33.33333(the more 3's, the more precision, but i think 5 decimals should do) instead of just 33.

var easeIn = new KeyframeEase(0, 33.33333);

var easeOut = new KeyframeEase(0, 33.33333);

master_comp.layer(1).property("Scale").setTemporalEaseAtKey(1, [easeIn, easeIn, easeIn], [easeOut, easeOut, easeOut]); // key index = 1

Participating Frequently
September 10, 2018

thank you