Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Parenting expression experement!

  • Parenting expression experement!

    Posted by Reynolds Strother on February 15, 2008 at 5:12 pm

    Hey everybody, I’m a green horn when it comes to AE expressions. I’m sure somebody at the Cow can tell me if this is possible and if so, how?

    The idea is to use an expression for parenting a layer to then layer above it.(above or below, either or). I assume using the stack order, “index”, is the way. Not sure if parenting is possible in an expression though.

    In my mind this would be handy when duplicating multiples of the same layer. This would automatically create a chain between all the layers next to each other in the stack as they are duplicated. That would save tons of time trying to parent, lets say 100 layers, one by one, to the next layer above it. All you would need is to duplicate the layer 100 times.

    I’m hoping to create a chain of objects, all spaced end to end, and have them follow the transforms of the one before it. I know it can be done without an expression but, I want to automate this setup as much as possible.

    Hope this isn’t a foolish question, I’ll appreciate any help, thanks everybody.

    Oliver Smith replied 13 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 16, 2008 at 10:46 pm

    You can’t control parenting with expressions, but it’s a simple job for a script. You’d get all your layers set up and then run a script like this:

    var myComp = app.project.activeItem;
    for (var i = myComp.numLayers; i > 1; i–){
    myComp.layer(i).parent = myComp.layer(i-1);
    }

    Dan

  • Reynolds Strother

    February 17, 2008 at 8:47 pm

    Awesome, thanks Dan. Love your site, already have gotten tons of ideas for expression uses from it.

  • Oliver Smith

    May 31, 2012 at 10:15 am

    Thanks Dan, you have saved me hours in the last 2 days!

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