this is my first time asking a question rather than just randomly googling. And forgive me in advance i am greener than green when it comes to JS and ES.
I am trying to reverse engineer this code i found on here:For loop in Adobe ExtendScript
It works beautifully but it only allows me to insert one Keyframe Ease value across both the in and out of a keyframe. I want to be able to separate them so i can use ease1 and ease2 rather than just ease1. Any help would be greatly appreciated!
function storeKeyframes(){
var comp = app.project.activeItem;
if (!comp || comp.typeName !== "Composition") return;
var properties = comp.selectedProperties;
var i, I=properties.length;
var ease1 = new KeyframeEase(0,30);
var ease2 = new KeyframeEase(0,45);
for (i=0; i<I; i++){
if (properties[i] instanceof Property) setEase(properties[i], ease1);
};
};
function setEase(property, ease1){
var ease = property.propertyValueType===PropertyValueType.Two_D ? [ease1, ease1] : (property.propertyValueType===PropertyValueType.Three_D ? [ease1, ease1, ease1] : [ease1]);
var keySelection = property.selectedKeys;
var i, I=keySelection.length;
for (i=0; i<I; i++){
property.setInterpolationTypeAtKey(keySelection[i], KeyframeInterpolationType.BEZIER, KeyframeInterpolationType.BEZIER);
property.setTemporalEaseAtKey(keySelection[i], ease, ease);
};
};