Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to move a 3d layer in the x y and z axis

  • Expression to move a 3d layer in the x y and z axis

    Posted by Chad Goodwood on April 30, 2013 at 1:18 pm

    Hi All,

    I’m putting together an animation that involves several layers following each other like a Fan. Not being a guru in exprssions I have found a fan card expression and would like to adapt it or add a new null so that I can move the layers in the x, y a z space. The fan expression is:

    fanAmount = thisComp.layer(“card fan”).effect(“Fan Amount”)(“Angle”);
    fanOffset = thisComp.layer(“card fan”).effect(“Fan Offset”)(“Angle”);
    targetCard = thisComp.layer(“card fan”).effect(“Target Card Index”)(“Slider”);

    (index – targetCard)*fanAmount + fanOffset

    This works very well, so I have been looking around for an expression that will move each layer simultaneously and have so far gone done the route of creating another null layer to control the x y and z with sliders, but I just can’t get it to work. I’m sure it’s very straight forward!

    Any ideas, solutions gratefully received!!

    Thanks
    Dave

    Chad Goodwood replied 13 years, 3 months ago 3 Members · 7 Replies
  • 7 Replies
  • Thor Sarup

    April 30, 2013 at 1:44 pm

    Can you share (a simple version) of the project? I’m not following you completely. What do you mean by “move each layer simultaneously”?

  • Chad Goodwood

    April 30, 2013 at 2:08 pm

    Hi Thor,

    Thanks for the swift reply. The project is fairly large so what I’ve done is upload a still so you get an idea of what’s happening.

    Basically as the flowers are coming towards you I’d like to be able to have the option to move them apart in either x, y or z axis. Does that make sense?

    Cheers
    Dave

  • Thor Sarup

    April 30, 2013 at 2:49 pm

    looks cool 🙂 so right now the flowers twirl out (scales too?)
    But what prevents you from moving the flowers by key frames?

  • Dan Ebberts

    April 30, 2013 at 3:13 pm

    I haven’t tested this, but I would think it’s going to look something like this:

    x = thisComp.layer(“card fan”).effect(“X Offset”)(“Slider”);
    y = thisComp.layer(“card fan”).effect(“Y Offset”)(“Slider”);
    z = thisComp.layer(“card fan”).effect(“Z Offset”)(“Slider”);
    targetCard = thisComp.layer(“card fan”).effect(“Target Card Index”)(“Slider”);

    value + [x,y,z]*(index – targetCard);

    Dan

  • Chad Goodwood

    April 30, 2013 at 3:19 pm

    Hi Dan

    Thanks for the post I, will test and get back with the results!

    Cheers
    Dave

  • Chad Goodwood

    April 30, 2013 at 3:22 pm

    Yes they are twirling and moving towards the camera, but the script I’m using only gives me control over the z axis for each layer, but not the x or y.

    Cheers
    Dave

  • Chad Goodwood

    April 30, 2013 at 4:41 pm

    Dan,

    You’re spot on!!! Works a treat, thank you so much, it’s really appreciated!

    Cheers
    Dave

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