Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Whats the best way to multiple a layer over a hundred times?

  • Whats the best way to multiple a layer over a hundred times?

    Posted by Daniel Haskett on June 1, 2006 at 11:43 pm

    hi there

    Bascially ive got a scene where I want hundreds of the same tree to appear. Ive got it on 1 layer at the moment as a single tree. Now do i ahve to precompose the layer and copy it 500 times in the separate composition and animate them all coming on, or perhaps create one layer in photoshop and individually mask each one on…….?

    Those were my two plans but I just wondered if anyone knew of any simpler quicker ways! Like using expressions or anything similar to that?

    Cheers for your help,

    Dan

    Daniel Haskett replied 19 years, 11 months ago 5 Members · 8 Replies
  • 8 Replies
  • Sam Moulton

    June 2, 2006 at 12:06 am

    i saw a tutorial somewhere that used card dance to make an army. you could put a bunch of your trees on a layer say a 10 x 20 grid, then set up card dance to break them up and stand them up and distribute them. this way you would only need about 3 or 4 layers with a bunch of trees on each layer. bet it would render much faster than 500. bty i’ve been playing with card dance recently and you control it with a gradient. it’s loads of fun

  • Roland R. kahlenberg

    June 2, 2006 at 12:25 am

    Card Dance will not rpelicate the layers for you. What it does is to break up what you already have. best bet would be a particle system such as Particle Playground or Trapcode’s Particular. Trapcode’s Echospace should also do the trick. I suggest that you download their trial versions and give it a go.

    HTH
    Roland Kahlenberg
    broadcastGEMs
    customizable animated backdrops with Adobe After Effects project files

  • Mike Clasby

    June 2, 2006 at 12:49 am

    This, modified from an earlier post:

    https://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=2&postid=866995

    For example, if you want your final Comp to be 640×480 (where card Dance is used) and have a 10×10 grid (rows and columns

  • Mike Clasby

    June 2, 2006 at 12:56 am

    I left this beginning part out. There are two methods here:

    1st – Add one tree layer to a comp, Use Dan Ebbert’s Grid expression (for position) to distribute the trees in a grid (they grid up automatically when you dup them, then use Card Dance to distribute the trees via a gradient.

    2nd – Dup your tree layer and use Colin’s Random Z (modified) expression to distribute trees randomly in Z and X.

  • Mike Clasby

    June 2, 2006 at 8:18 am

    Brainstorm, methinks.

    I took Colin’s Random Z expression mentioned before, modified it for X, Y and Z, tied sliders to the min and max of each X, Y and Z (6 siders on a null layer, and you get great contol of a randomly placed forest of trees.

    1st make a Null Layer, Name it “Sliders”.
    Effect>Expression Control>Slider Control.
    Right Click the Value (now 0) and change the Slider Range to -1000 to +1000.
    Dup it 5 more times (6 sliders total).
    Name them:
    X Min Slider
    X Max Slider
    Y Min Slider
    Y Max Slider
    Z Min Slider
    Z Max Slider

    Set preliminary values for the slider like:

    X Min Slider: – 250
    X Max Slider: 250
    Y Min Slider: -10
    Y Max Slider: 100
    Z Min Slider: -250
    Z Max Slider: 250

    Here’s the expression, put this on the position of a 3D tree layer:

    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 )]

    Note: If the expression gets that little warning flag, it’s probably the naming of the sliders, so highlight the:

    thisComp.layer(“Sliders”).effect(“X Min Slider”)(“Slider”)

    and then pickwhip to the appropriate slider in the null layer, to get the naming right.

    Now dup the tree layer as many times as you want randomly placed but controlable trees in your forest.
    And with the Sliders you can move your forest around until you like the look.
    Add a camera and have a fly through.

    Like all my expression creations this is a hack off a pre-exsisting expression (Colin’s) so it’s probably a little clumsy.
    If you can’t get this to work I could email the aep, it’s just less than 1 MB.

  • Fabiano Peres

    June 2, 2006 at 12:01 pm

    Hi, I know that a lot of people have already told you how to create it, but I just want you to see this v

  • Daniel Haskett

    June 4, 2006 at 11:58 pm

    Hey guys, thanks for all the help, i really appreciate your time!

    Ive been giving it a go and am getting somewhere with it…only thing Im having trouble with is using a gradient to make them distribute, ive got the grid of the images, but i cant the gradient layer to do anything. When i bring in a layer and say that it is the gradient layer, it doenst do anything to the images, i mean they dont start appearing or soemthing similar….is that meant to happen?

    cheers

    dan

  • Daniel Haskett

    June 5, 2006 at 12:00 am

    hey man if u could email it to me id really appreciate it! its just im new to expressions so finding it a little hard to get my head around it, i think if i coudl look at it and then refer to what youve written that might help alot!

    thanks for everyones help!

    dan

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