-
Scale in + out based on layer length
I found the below expression for scaling a layer in and out based on its length which works well.
The issue is I was hoping to save it as a preset and this relies on the layer name being referenced which doesn’t make it the most efficient when applying it to multiple layers at the same time.
Is there a way of simplifying this to allow it to be reusable or a better method?
John
startScale = [0,0];
endScale = [100,100];
layername = "Shape Layer 1";if(time < (thisComp.layer(layername).inPoint+thisComp.layer(layername).outPoint)/2)
ease(time,thisComp.layer(layername).inPoint,thisComp.layer(layername).inPoint+0.2,startScale,endScale)
else
ease(time,thisComp.layer(layername).outPoint-0.2,thisComp.layer(layername).outPoint,endScale,startScale);UPDATE, SOLVED
Worked out solution by using index if anyone is interestedstartScale = [0,0];
endScale = [100,100];if(time < (thisComp.layer(index).inPoint+thisComp.layer(index).outPoint)/2) ease(time,thisComp.layer(index).inPoint,thisComp.layer(index).inPoint+0.2,startScale,endScale) else ease(time,thisComp.layer(index).outPoint-0.2,thisComp.layer(index).outPoint,endScale,startScale);