Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects scripting- creating a random number

  • scripting- creating a random number

    Posted by Jakob Thommessen on August 24, 2006 at 11:25 am

    hi,

    anybody knows a way to create a random number that stays the same (does not create a new value every frame)?
    i wish to multiply the rotation value of a lot of layers with random values ranging from 1-3.

    any help is much appreciated!

    Jakob.

    Mylenium replied 19 years, 8 months ago 3 Members · 2 Replies
  • 2 Replies
  • Aronduby

    August 24, 2006 at 2:29 pm

    seedRandom(1,true);
    multiplier = random(1,3);
    rotation*multiplier;

    that should do it, the seedRandom(#,true) is what keeps it the same, actually just the true value. I’m not 100% sure whats going on with it, but the property is called “timeless” and setting it to true makes the random number not change every frame. If you use it on different layers and want a different random number, make sure to change the number thats the first value in the parenthesis.

  • Mylenium

    August 24, 2006 at 3:42 pm

    [AronDuby] “I’m not 100% sure whats going on with it, but the property is called “timeless” and setting it to true makes the random number not change every frame.”

    What it says – “timeless”. Eternally beautiful randomness for you to enjoy ;O). Na, it will stop the underlying Perlin noise calculations (Perlin noise is based on multiple overlapping sinus/ cosinus waves, so your waves are simply stopped).

    Mylenium

    [Pour Myl

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