Increment and hold

Moderators: Disciple, zlovatt

Post Reply
perpen
Posts: 3
Joined: February 9th, 2008, 5:39 am

Hi,

I am trying to move a layer in X then hold for 1 sec., then move again. I have tried this expresion I found in this forum (Dan):

stepTime = 2;
opacityIncrement = 20;
currentStep = Math.floor(time / stepTime);
value - currentStep*opacityIncrement

It works but now the increments are without transition (interpolation). They occur in a sudden way. I would like the increments with a interpolation between them and the next hold.

Thanks in advance.
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

Try this expression:
Where riseTime is the transition time.

Code: Select all

stepTime = 2;
riseTime = 1;
opacityIncrement = 20;
currentStep = Math.floor(time/stepTime);
value - currentStep*opacityIncrement + ease(time-currentStep*stepTime, 0, riseTime, 1, 0)*opacityIncrement;
Koby.
perpen
Posts: 3
Joined: February 9th, 2008, 5:39 am

That was just pereftc. Thank you very very much. Owe you a beer!. :)
Post Reply