Activity › Forums › Adobe After Effects Expressions › slider expression
-
slider expression
Posted by Riccardo Sinti on December 1, 2009 at 10:17 pmI would like to add an expression to a slider control that says:
starting at “time” subtract or add “amount” over “time” then hold for “time” then repeat.
does this make sense?
Riccardo Sinti replied 16 years, 9 months ago 2 Members · 3 Replies -
3 Replies
-
Riccardo Sinti
December 1, 2009 at 10:21 pmright now I’m just keyframing the slider to subtract 250 over ten frames then hold for two seconds then again subtract 250 over ten frames then hold for two seconds.
I can put eases on the keyframes, what about in an expression.Thanks (I’ll learn this stuff one day)
Thank You
-
Dan Ebberts
December 1, 2009 at 10:32 pmSomething like this:
moveTime = 10; // frames
holdTime = 2.0; // seconds
amount = -250;segDur = moveTime*thisComp.frameDuration + holdTime;
seg = Math.floor(time/segDur);
t = time%(segDur);
value + seg*amount + linear(t,0,moveTime*thisComp.frameDuration,0,amount)Dan
-
Riccardo Sinti
December 2, 2009 at 7:01 pmWow that works like a charm, thank you very much, but the code is very complex to me any chance you can expound on the different parts of it.
1 question why is “moveTime = 10; // frames” in frames but “holdTime = 2.0; // seconds” is seconds how are frames distinguished from seconds?Thank You
Reply to this Discussion! Login or Sign Up