Copy link to clipboard
Copied
Instead of using Keyframe assistaant > Exponential Scale, I would like to use an expression on the Scale property. What would be the correect expression taking into account scale at inpoint, scale at outpoint and duration between inpoint and outpoint? (my picture is zooming out)
Thanks !
tStart=key(1).time;
tEnd=key(2).time;
tDiff=tEnd-tStart;
vStart=valueAtTime(tStart);
vEnd=valueAtTime(tEnd);
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
Mylenium
Copy link to clipboard
Copied
Something like this perhaps:
tStart=key(1).time;
tEnd=key(2).time;
tDiff=tEnd-tStart;
vStart=valueAtTime(tStart);
vEnd=valueAtTime(tEnd);
vDiff=vEnd-vStart;
vStart+Math.exp(tDiff)*vDiff;
Mylenium
Copy link to clipboard
Copied
Thanks Mylenium. Sorry, I should have mentionned that current time should be taken into account to have the exponential scaling from tStart to tEnd. How would you fit the (time-inpoint) within your expression ? I tried to but was unable. Thanks !
Copy link to clipboard
Copied
If you want the animation to start at the in point of the layer: tStart = inPoint;
If you want the animation to end 1 second before the out point of the layer: tEnd = outPoint - 1;
Check the expression I posted.
Copy link to clipboard
Copied
Thank you !
Copy link to clipboard
Copied
tStart=key(1).time;
tEnd=key(2).time;
tDiff=tEnd-tStart;
vStart=valueAtTime(tStart);
vEnd=valueAtTime(tEnd);
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
Mylenium
Copy link to clipboard
Copied
Something like this maybe:
t1 = inPoint;
t2 = outPoint - thisComp.frameDuration;
v1 = valueAtTime(t1);
v2 = valueAtTime(t2);
if (time < t1){
v1;
}else if (time > t2){
v2;
}else{
d = t2 - t1;
dv = v2 - v1;
t = (time - t1)/d;
v1 + dv*Math.exp(10*(t-1));
}
Copy link to clipboard
Copied
If you want to work without keyframes, try this version of Mylenium's expression:
tStart=inPoint;
tEnd= inPoint + 2;// move time in seconds
tDiff=tEnd-tStart;
vStart=[10, 10];// starting Scale
vEnd=[70, 70];// ending Scale
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
The math does not match applying the Keyframe Assistants' Exponential Scale perfectly, but it looks pretty good.
Change line two to tEnd = outPoint, and the animation will last as long as the layer.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now