ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Random expression in frames

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Patrick Murphy
Random expression in frames
on Feb 7, 2017 at 7:50:39 pm

Hi there!

I have this script but instead of hold time in seconds, I'd like it to be hold time in frames.
I've looked around and tried some things but I'm still a bit of a noob.
Thanks!

Here's the expression I have to convert

hold = .5; //time to hold each number (seconds)
min = -1;
max = 1;

seed = Math.floor(time/hold);
seed_random(seed,true);
random(min,max)


Return to posts index

Kevin Camp
Re: Random expression in frames
on Feb 7, 2017 at 8:06:10 pm

you can convert a frames value to time, or a time value to frames... i think i'd use the first option like this

hold = 15; //time to hold each number (frames)
min = -1;
max = 1;

seed = Math.floor( time / framesToTime( hold ) );
seed_random( seed, true );
random( min, max )

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Patrick Murphy
Re: Random expression in frames
on Feb 7, 2017 at 8:10:21 pm

Thank you so much!!


Return to posts index

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