ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

counting up

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
tom robertson
counting up
on May 9, 2018 at 3:12:33 am

Hi,

I want to increment a slider in integers(0,1,2,3,4...) to a certain value. The problem is that I don't want the slider to increase linearly with the time. I want the slider to update randomly, so that there's the chance of holding a value up to 3s before it goes to the next one.

Example:

slider value @ time
0 ....................................0s
1 ................................ 0.7s
2..................................0.8s
3..................................3.2s
4..................................5.9s
5..................................8.6s
[...].................................[...]
50...............................57.2s


Return to posts index

Dan Ebberts
Re: counting up
on May 9, 2018 at 4:10:17 am

Try this:


minIncr = .1;
maxIncr = 2.5;
tNext = tPrev = 0;
i = -1;
seedRandom(index,true);
while (tNext <= time){
tPrev = tNext;
tNext += random(minIncr,maxIncr);
i++
}
i



Dan



Return to posts index

tom robertson
Re: counting up
on May 9, 2018 at 8:09:40 pm

Brilliant! It works perfectly and this expression really opened my mind !
Thanks a LOT!

Tom


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]