Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Randomize position while preventing overlapping

  • Randomize position while preventing overlapping

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

    I want to write an expression that will generate a random position everytime I duplicate a shape layer, which is a small dot. So far, what I have is:

    seedRandom(index,true);

    x = random(-40, 40)
    y = random(-1500, 0);

    [x,y];

    This works fine, however I will be making hundreds of little dots, and do not want any of them to overlap. Is there a way to incorporate something into the expression to say that if the random return matches within a certain range of the other layers, to start over, and keep repeating until it finds a new unique position? I feel there is, but this is delving into a whole part of expressions that I am unfamiliar with.

    Jeff Holcomb replied 10 years, 4 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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