Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Crowd replication

  • Crowd replication

    Posted by David Lee on November 5, 2007 at 12:00 am

    I am attempting to create a crowd within a stadium and wish to use some expressions to simplify the process. I stumbled accross this one

    minX =thisComp.layer(“Sliders”).effect(“X Min Slider”)(“Slider”);//Minimum x value
    maxX =thisComp.layer(“Sliders”).effect(“X Max Slider “)(“Slider”);//Maximum x value

    minY =thisComp.layer(“Sliders”).effect(“Y Min Slider “)(“Slider”);//Minimum y value
    maxY =thisComp.layer(“Sliders”).effect(“Y Max Slider “)(“Slider”);//Maximum y value

    minZ = thisComp.layer(“Sliders”).effect(“Z Min Slider “)(“Slider”);//Minimum z depth value
    maxZ = thisComp.layer(“Sliders”).effect(“Z Max Slider “)(“Slider”);//Maximum z depth value

    seedRandom(index, true);

    x = random(minX, maxX);
    y= random(minY, maxY);
    z = random(minZ, maxZ);

    [Math.round(x), Math.round(y), Math.round( z )]

    which links the 3d layer to sliders, but does so randomly. I wish to have more deliberate control over the layers however.

    I have locators imported from maya to assist with the initial placement of key crowd elements, but would like an easier way to fill in the gaps, by simply duplicating the crowds at the locators, and using a slider to move them along till the fill the rows. Is this possible?

    Thanks

    Dave

    Mike Clasby replied 18 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Mike Clasby

    November 5, 2007 at 1:47 am

    This should work. Here is an earlier thread on how to spread out layers in 3D space with a slider. I set it up for z space, but you could add sliders for x and y spread. Here’s the thread:

    https://forums.creativecow.net/readpost/227/8455

    Just add new sliders, one named xSpread, and another ySpread, and one for zSpead, then add this expression to position:

    xOffset = thisComp.layer(“Leader”).effect(“xSpread”)(“Slider”);
    yOffset = thisComp.layer(“Leader”).effect(“ySpread”)(“Slider”);
    zOffset = thisComp.layer(“Leader”).effect(“zSpread”)(“Slider”);
    x = thisComp.layer(“Leader”).position[0] + (index-1)*xOffset;
    y = thisComp.layer(“Leader”).position[1] + (index-1)*yOffset;
    z = thisComp.layer(“Leader”).position[2] + (index-1)*zOffset;
    [x, y, z]

    The expression will distribute the layer from “Leader”‘s position, so if you change that line to the name of the layer for your Maya locator (I’m lost about Maya), then it should work. You’ll be able to control their spread with sliders.

    Alternatively, there is a neat tutorial on crowd generation with Trapcode’s Particular, search here and maybe Google, or look at Trapcode.

  • David Lee

    November 5, 2007 at 8:30 pm

    Cool, thanks for the quick reply. That almost works, but they layers don’t seem to be spreading out evenly. They all move the same amount so theres only 2 groups of people, the “leader”, and the rest which are all sitting on top of each other.

    Any ideas?

    Dave

  • David Lee

    November 5, 2007 at 9:15 pm

    Ahh my bad, I didn’t have them right at the top of the comp. But is there anyway to have the z axis stagger itself apart as your expression is doing, but have the x and y sliders move the crowd up one step at a time, rather than staggering them?

    dave

  • Mike Clasby

    November 6, 2007 at 1:45 am

    I guess I don’t understand what you’re asking, “move the crowd up one step at a time”?

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