Ease ease is still quite simple, other than that could be difficult to explain/manage…
The KeyframeEase object requires 3 components (X,Y,Z), even in 2D, can’t figure out why.
Also, you don’t need the speed, influence, easeIn, easeOut variables below, they are there just to tell the meaning of this things inside the parenthesis.
Xavier.
var BEZIER = KeyframeInterpolationType.BEZIER;
var LINEAR = KeyframeInterpolationType.LINEAR;
var speed, influence, easeIn, easeOut;
var ease = new KeyframeEase(speed=0, influence=33.33333);
var key1, key2;
var myScale = app.project.activeItem.layer(1).property("scale");
// set the values at times
myScale.setValueAtTime(0,[0,0]);
myScale.setValueAtTime(1,[100,100]);
myScale.setValueAtTime(5,[130,130]);
myScale.setValueAtTime(6,[0,0]);
// get the key indices and set the rest
key1 = myScale.nearestKeyIndex(1);
key2 = myScale.nearestKeyIndex(5);
myScale.setTemporalEaseAtKey(key1, easeIn=[ease, ease, ease], easeOut=[ease, ease, ease]);
myScale.setTemporalEaseAtKey(key2, easeIn=[ease, ease, ease], easeOut=[ease, ease, ease]);
// (optionnal) overwrite outter tangents (Bezier ---> Linear)
myScale.setInterpolationTypeAtKey(key1, LINEAR, BEZIER);
myScale.setInterpolationTypeAtKey(key2, BEZIER, LINEAR);