Page 1 of 1

Increment and hold

Posted: November 20th, 2008, 3:17 pm
by perpen
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.

Re: Increment and hold

Posted: November 21st, 2008, 10:57 am
by kobyg
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.

Re: Increment and hold

Posted: November 25th, 2008, 2:02 am
by perpen
That was just pereftc. Thank you very very much. Owe you a beer!. :)