Activity › Forums › Adobe After Effects Expressions › Scale expression start at specific time
-
Scale expression start at specific time
Posted by James Ireland on April 14, 2009 at 11:51 amHello.
Firstly sorry if this has been posted already. I can’t seem to find the answer anywhere… also new to expressions.
I found this excellent scale expression at mographwiki
k=16;
a=5;
b=20;
x=k*(1-Math.exp(-a*time)*Math.cos(b*time));
[x,x]but I would like to start it at a specific time
I found this by Dan Ebberts
timeToStart = 4; // start at 4 seconds
if (time < timeToStart){ deltaX = 0; }else{ t = time - timeToStart; veloc = 7; amplitude = 80; decay = .7; deltaX = amplitude*Math.sin(veloc*t)/Math.exp(decay*t); } value + [deltaX,0] Is it possible to remove the organic wiggle and replace with the scale? Thanks in advance. J
Edy Brown replied 11 years ago 3 Members · 10 Replies -
10 Replies
-
Dan Ebberts
April 14, 2009 at 1:14 pmLike this, probably:
timeToStart = 4;
if (time >= timeToStart){
t = time – timeToStart;
k=16;
a=5;
b=20;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]
}else{
[0,0]
}Dan
-
James Ireland
April 14, 2009 at 4:49 pmExcellent thank you Dan.
I managed to find another of your expressions that triggers on layer start, very useful.
-
James Ireland
April 17, 2009 at 3:55 pmHello again. Another question if I may.
I’ve ended up using the following expression for scale bounce which as you can see starts the movement on the layer in point. How can I make this happen in reverse and with a time trigger? So going from a 100% scale object that ‘bounces’ to 0% at a set time (or layer end?)
Scale up on layer in…
k=100;
a=5;
b=25;
t = time – inPoint;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]Scale up at set time…
timeToStart = 4;
if (time >= timeToStart){
t = time – timeToStart;
k=16;
a=5;
b=20;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]
}else{
[0,0]
}Thanks in advance for the help…
-
Dan Ebberts
April 17, 2009 at 6:09 pmYou can make the first expression run in reverse like this:
k=100;
a=5;
b=25;
t = outPoint – time;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]Dan
-
James Ireland
April 19, 2009 at 8:07 amBrilliant that’s great Dan. I did however need the scale expression to occur after the first scale in and I’m unsure how to join the 2 expression together.
So either with time in then time out or as a layer that scales in on layer start and out on layer end.
I need it to happen on several layers throughout the comp at different times. Basically objects bouncing in and around then out as other layers mask in from behind.
Again apologies for my complete lack or expression knowledge. I thought I would dip my toe into expressions on this project, it’s all very interesting, some amazing time savers out there. Paul Tuersley’s PSD to 3D is incredible!…and of course thanks for all your help so far.
J
-
Dan Ebberts
April 19, 2009 at 1:47 pmTry this:
k=100;
a=5;
b=25;
if ( time < (inPoint+outPoint)/2){ t = time - inPoint; }else{ t = outPoint - time; } x=k*(1-Math.exp(-a*t)*Math.cos(b*t)); [x,x] Dan -
Edy Brown
April 21, 2015 at 5:04 pmHi,
Does anyone have an idea how to use this expression in and out? (actually it works for IN, but i don’t know how to re-use it to make scale up at the end…)
Thanks
startScale = 300; // percent of Scale at start
endScale = 100; // percent of Scale at end
scaleUpTime = 1; // time to scale up from inPoint in seconds
s = ease(time,inPoint,inPoint+scaleUpTime,startScale,endScale);
[s,s]
-
Dan Ebberts
April 21, 2015 at 5:59 pmIf you want it to do both, it would be something like this:
startScale = 300; // percent of Scale at start
endScale = 100; // percent of Scale at end
scaleUpTime = 1; // time to scale up from inPoint in seconds
if (time < (inPoint+outPoint)/2)
s = ease(time,inPoint,inPoint+scaleUpTime,startScale,endScale)
else
s = ease(time,outPoint-scaleUpTime,outPoint,endScale,startScale);
[s,s]Dan
-
Edy Brown
April 21, 2015 at 7:23 pmThank you Dan!
That works perfectly.I am following creative cow for many years now, and found there most of the solution to the issues i got, (and it is the first time that i am taking part in a forum, what a shame!).
Thanks you for all.Edgar
Reply to this Discussion! Login or Sign Up