easy ease

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
tc123
Posts: 1
Joined: April 28th, 2014, 3:39 pm

Hey there,

I've been getting into coding for a massive two days now and have managed to create my first working script... hurray!
I have applied some scale keyframes to selected layers using the following:

Code: Select all

var myScale = myLayer[i].property("scale");
myScale.setValueAtTime(1,[100,100]);
myScale.setValueAtTime(5,[130,130]);
everything is all good but can someone explain to me if it's possible to code the default easy ease keyframes that you get by hitting F9 in AE rather than the standard keyframes?

any help/explanation would be much appreciated!
chriskelley
Posts: 4
Joined: August 1st, 2012, 5:22 pm

Hey tc123 -

You can control the easing of keyframes using the "setTemporalEaseAtKey()" method, which makes use of the KeyframeEase Object. You will need to use both things to set easing for your keyframes.

One thing to watch for is that you are setting your keyframes with setValueAtTime(), but setTemporalEaseAtKey() will reference your keyframes based on index, not time.

Another thing to watch for is if your layer is 2D or 3D - you will need to pass setTemporalEaseAtKey() arrays of different lengths since you are using a property that can be either 2 or 3 dimensions.

Good luck!
Chris
Post Reply