Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects why does random(min,max) not work with time remapping?

  • why does random(min,max) not work with time remapping?

    Posted by Scott G on October 31, 2006 at 5:38 am

    i’ve tried it on other values, and it works, randomising between the min and max. but time remap doesn’t work at all… generates all kinds of crazy numbers! for example, random(1,16) in a 16 frame comp is producing time remap values of 236, 198, etc.

    Dan Ebberts replied 19 years, 6 months ago 3 Members · 5 Replies
  • 5 Replies
  • Colin Braley

    October 31, 2006 at 5:46 am

    I suspect that this is your problem:
    – The time remap parameter expects its number in terms of seconds not frames. So when you say random(1,16) it giving time remap a number between 1 second and 16 seconds. IF you wanted a value between one frame and 16 frames you could do it like this:

    temp = random(1,16);
    timeToFrames( temp )

    or you could code it more succinctly:

    timeToFrames( random( 1 , 16 ) )

    Enjoy.
    ~Colin

  • Scott G

    October 31, 2006 at 6:34 am

    wow, i didn’t realise that about time remap. the numbers in the timeline switches window (where you get the readouts for position rotation etc) are in frames, not like 00:00:00:00, so i had no idea it needed values in seconds.

    thanks for the tip!

  • Scott G

    October 31, 2006 at 6:42 am

    wait a sec… that’s still giving me massive values though, as it’s converting 16seconds to frames, so the value isn’t 16 it’s 400. or something else entirely, the code is spitting out values in the thousands now.

    i tried putting in temp+random(0, 0.64) for 0 seconds, 16 frames, but this doesn’t work either.

    i can’t figure it out… if i keyframe it i can put in values of 0001, 0006, 0016, but if i random(1,16) surely this should be the same thing? it doesn’t look like time remap requires times of seconds at all…

  • Scott G

    October 31, 2006 at 6:48 am

    random(1, 16)/25 for pal footage.

    it was that simple all along…

    your tip was still valid, colin! thanks.

  • Dan Ebberts

    October 31, 2006 at 6:48 am

    Give this a try:

    random(16*thisComp.frameDuration)

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy