Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Question regarding randomSeed()

  • Question regarding randomSeed()

    Posted by Jeff Holcomb on April 17, 2016 at 4:35 am

    As I understand it, having a seed as a constant, like randomSeed(3), should generate the same set of random numbers. However, I’ve put this expression into a shape layer’s position and duplicated it, and it creates two shapes that randomly jump around, but not in unison with eachother:

    seedRandom(3,false);
    x = random(-10,10);
    Y = random(-10,10);
    [x,y];

    Because both shapes have the seed being set to 3, shouldn’t they have the same set of random values? Is there something I’m missing?

    Dan Ebberts replied 10 years, 4 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 17, 2016 at 6:23 am

    Behind the scenes, the layer ID somehow gets factored into the seed, so each layer exhibits different random behavior.

    Dan

  • Jeff Holcomb

    April 17, 2016 at 6:42 am

    Hi Dan, thanks for the response. So does that mean that putting any value into randomSeed() is pretty much pointless then, whether it’s a numerical value or ‘index’?

  • Dan Ebberts

    April 17, 2016 at 6:57 am

    It does affect the random sequence for that layer.

    If you need to correlate the random behavior of multiple layers, you can sometimes do it by doing the random calculation in a single expression in a central location (slider, point control, text layer, etc.) and “publishing” the result for the randomized layers. The specifics would depend on what you’re trying to do exactly.

    Dan

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