Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random population people icons on map

  • Random population people icons on map

    Posted by Dax Castro on April 16, 2018 at 6:44 pm

    What I am looking for is a script that will enable 50-100 people icons pop up on a map. Would love to be able to have them at random scales between two values. I know there are lots of posts about random placements, but I cannot find one that particularly fits my case and I am a script idiot so I am reaching out.

    Right now I just have a pre-comp with an icon in it that just scales in. Basically pops up/appears.

    This voiceover might better help give you a mental picture of what I am going for.

    “The population of Nebraska has grown from 2million to 20 million in the past 5 years”

    The people just seed in random areas at random scales.

    Thanks for the help in advance.

    Dax

    Dan Ebberts replied 8 years, 1 month ago 2 Members · 9 Replies
  • 9 Replies
  • Dan Ebberts

    April 16, 2018 at 7:03 pm

    These might get you started:

    // scale
    minScale = 50;
    maxScale = 150;
    rampTime = .25;
    seedRandom(index,true);
    s = random(minScale,maxScale);
    ease(time,inPoint,inPoint+rampTime,[0,0],[s,s])

    // position
    minX = 0;
    maxX = thisComp.width;
    minY = 0;
    maxY = thisComp.height;
    seedRandom(index,true);
    random([minX,minY],[maxX,maxY]);

    Dan

  • Dax Castro

    April 16, 2018 at 7:15 pm

    Good to know I was on the right track. the second part of your script was one I was playing with but couldn’t get it to produce any animation. I put the expression in the position layer, right?

    Thanks for the quick reply!
    Dax

    Dax

  • Dan Ebberts

    April 16, 2018 at 7:20 pm

    Yes, it’s a Position expression. What kind of animation are you looking for?

    Dan

  • Dax Castro

    April 16, 2018 at 7:28 pm

    I created the effect manually but figured there had to be a way to script it. This is what I did manually.

    https://youtu.be/_ROyrkIEbPM

    Dax

  • Dan Ebberts

    April 16, 2018 at 7:33 pm

    I don’t see any position animation, but it looks like the scale expression needs a random delay:

    // scale
    minScale = 50;
    maxScale = 150;
    maxDelay = 1;
    rampTime = .25;
    seedRandom(index,true);
    s = random(minScale,maxScale);
    d = random(maxDelay);
    ease(time,inPoint+d,inPoint+d+rampTime,[0,0],[s,s])

    Dan

  • Dax Castro

    April 16, 2018 at 8:00 pm

    The goal would be to:

    1. Set 1 comp “person”
    2. Appy Script that
    – Randomly populates the entire page (I can apply mask to manipulate where it shows up)
    – Randomly sets delay so the appearances stagger.

    Sorry I am doing a terrible job at explaining the goal.
    Hopefully that helped.

    Thanks!
    Dax

    Dax

  • Dan Ebberts

    April 16, 2018 at 8:37 pm

    Ah, sorry. I thought you were looking for expressions. That’s a little trickier, especially the masked area part. Certainly not something I can just post off the top of my head.

    Dan

  • Dax Castro

    April 16, 2018 at 10:16 pm

    No worries. The mask part is easy. I would just pre-comp that layer and apply a mask. Basically, I am looking for a script to fill the screen with a specific symbol of random sizes and random appearance times within a specific time range.

    “Fill up the screen in 5 seconds with X copies this specific image and vary the scale from 30-70% of actual.”

    Hey Dan, just wanted to thank you for being so responsive to everyone on the board. You really have helped me learn many new things.

    Thanks
    Dax

    Dax

  • Dan Ebberts

    April 16, 2018 at 11:12 pm

    It sounds very straightforward. Hopefully someone has time to crank it out for you.

    Dan

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