Increment and hold

Moderators: Disciple, zlovatt

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

November 20th, 2008, 3:17 pm

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

November 21st, 2008, 10:57 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

November 25th, 2008, 2:02 am

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