Activity › Forums › Adobe After Effects › Expression Speed ?
-
Expression Speed ?
Posted by Kevin Mcquade on May 3, 2006 at 3:27 pmHI, I have an expression controlling the rotation of a wheel. If I want the wheel to speed up a defined point, do I adjust the expression, or duplicate the layer, and just make the rotation faster?
KevSam Moulton replied 20 years ago 3 Members · 9 Replies -
9 Replies
-
Dan Ebberts
May 3, 2006 at 3:55 pmIf it’s a step change, you could do it like this:
rate1 = 180; // initial rate (degrees per second)
rate2 = 360; // final rate
speedUpTime = 3; // time to start using final rate (seconds)if (time < speedUpTime){ rate1*time }else{ rate1*speedUpTime + rate2*(time - speedUpTime) } If you need it to ramp up to the new speed it's a little more complicated, but still doable. Dan
-
Kevin Mcquade
May 3, 2006 at 4:04 pmCool, I’ll give it a shot!
And if I did want it too ramp up?
Kev -
Sam Moulton
May 3, 2006 at 5:18 pmi’m so lazy that I’d just add a slider and animate that. Dan’s advanced calculations scare me
-
Dan Ebberts
May 3, 2006 at 6:17 pmSomething like this should do it:
rate1 = 90; // initial rate (degrees per second)
rate2 = 360; // final rate
rampStart = 3; // start of ramp final rate (seconds)
rampEnd = 5; // end of ramp to final rateif (time < rampStart){ rate1*time }else if (time < rampEnd){ rate = linear(time,rampStart,rampEnd,rate1,rate2); rate1*rampStart + (rate + rate1)*(time - rampStart)/2 }else{ rate1*rampStart + (rate2 + rate1)*(rampEnd - rampStart)/2 + rate2*(time - rampEnd) } Dan
-
Kevin Mcquade
May 3, 2006 at 7:28 pmI tried animating a slider, but nothing happened. I’ll try to use this expression… but I think I too am about to cry.
Kev -
Kevin Mcquade
May 4, 2006 at 9:18 pmThanks Dan! That expression worked perfectly! Howz about making a layers position change with the beat of a tune? The pick whip puts my object in the corner of the comp!
Kev
-
Dan Ebberts
May 5, 2006 at 1:30 pmI’m assuming you’ve just pickwhipped your layer’s position to a keyframed slider created by “Convert Audio to Keyframes”.
To leave the layer in it’s original position and just offset it with the audio, you need to do something like this:
amplitude = 5;
temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
value + [temp, temp]*amplitudeAdjust “amplitude” to suit. Here’s another variation that just moves the layer up and down:
amplitude = 5;
temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
value – [0, temp]*amplitudeEtc. – you get the idea.
Dan
-
Kevin Mcquade
May 5, 2006 at 1:42 pmIt just keeps getting better!
Now… not to push my luck here, but what if I wanted the position of the layer to jump all over the place? I used to do it with Motion Math…
-
Sam Moulton
May 5, 2006 at 3:54 pmthat one I can do…
wiggle(2, 50)i think the first number is how many times a second, the second is how much. It may be the other way around….
Reply to this Discussion! Login or Sign Up