-
Changing time from seconds to frames in expression
Hello,
Please, the expression below has the time duration in seconds however I would like to change it to the number of frames.
Thank you in advance.Regards,
Obed
function easeInOutCubic(t, tMin, tMax, value1, value2){
b = value1;
c = value2-b;
d = tMax-tMin;
t = tMin < tMax ? thisLayer.linear(t,tMin,tMax,0,d) : thisLayer.linear(t,tMin,tMax,d,0);t /= d/2;
if (t <1) return c/2*Math.pow(t,3) + b;
t -= 2;
return c/2*(Math.pow(t,3) + 2) + b;
}duration = 1;
start=[-2000,540,-2000];
destination = [960,540,0];
exit = [2000,540,-3000];middle = (inPoint+outPoint)/2;
v = time < middle ? easeInOutCubic(time,inPoint,inPoint+duration,start,destination) : easeInOutCubic(time,outPoint-duration,outPoint,destination,exit);