Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Cloning objects in 3D

  • Cloning objects in 3D

    Posted by Dmitry Kichenko on November 7, 2007 at 8:55 pm

    I suspect this is going to be more of a scripting question but should be fairly simple.

    I have a single 3D layer which I would like to clone a number of times with a particular Z-axis offset so when looking through the active camera it appears that the domino-like row of the objects descends into infinity. I will be digging around Javascript and AE’s object classes and methods tonight, but I’m suspecting this should be a fairly easy script to put together. Can anyone point me in the right direction on this one?

    Thanks in advance.

    Dmitry Kichenko replied 18 years, 5 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dmitry Kichenko

    November 7, 2007 at 11:22 pm

    I’m pretty sure I found the way. Pretty simple like I thought. Running a loop that uses the duplicate() method on a selected layer, changes the name attribute of the object and then adds a particular value to the position[2] (the z axis value) should do it for me. Running a prompt() function to provide a way for the user to punch in the number of clones and how far they’re spaced out should complete the picture.

    AE peeps – am I on the right track? Sounds like it. The JS syntax and OOP model is quite a bit like that of PHP and esp. ActionScript so should be a piece of cake.

  • Dan Ebberts

    November 8, 2007 at 12:30 am

    Depending on your requirements, you could also use a position expression like this and then duplicate the layer a zillion times (which is actually pretty quick with Ctrl+D).

    offset = 25;
    value + [0,0,offset*(index-1)]

    Dan

  • Dmitry Kichenko

    November 8, 2007 at 12:46 am

    That’s an idea. Forgot about the index attribute. However, that leaves little flexibility if I desire to change the offset variable down the line, doesn’t it. When you define it like that its scope is within the current object right?

  • Dan Ebberts

    November 8, 2007 at 1:32 am

    Yes, but if you linked then offset to a slider control applied to a null, then duplicate the layer, you can adjust all the offsets at once.

    Dan

  • Dmitry Kichenko

    November 8, 2007 at 1:49 am

    Nice idea, could definitely work. Because at this point I’m not sure how to keep a script running at all times. Adjusting the offset with a script will require for it to somehow float around in a GUI of its own, but that would be cool explore. I’ll do it my way as well anyhow. Learn more doing things the hard way.

  • Dmitry Kichenko

    November 10, 2007 at 7:16 pm

    Just reporting back.

    Your way worked, thanks a lot Dan. I just needed to adjust the equation to (index-2) as once I created a null layer the index shifted. I’ve also written a formula to decrease the opacity of each new layer so that the images appear to be fading into infinity.

    As to doing it the script way, I’m still learning how to program GUI’s. Okay, MAYBE, the expression was IS faster :P.

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