Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
thank you
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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:
Can you help me figure out what I'm doing wrong?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
If I wanted the zoom to start slow and then accelerate over time, do you know how I would set the key frames?
Copy link to clipboard
Copied
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!