Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions control X and Z position

  • control X and Z position

    Posted by Afshar Afshar on April 19, 2009 at 12:29 pm

    hello

    I have an expression that distributes all my layers on the x axis.

    gap = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    startingPos = [ 0, 240, 0 ];
    //--
    dispVec = [10, 0, 0];
    i = index - 10;
    startingPos + (i * gap * dispVec)

    now I would like to have an extra slider where I can control the
    Z position of these layers.

    but since I’m very bad at this, I can’t seem to adapt the script to also make it work for the Z axis. whenever I get it to work for Z it breaks the X. can anyone help me out with this? thank you.

    greetings

    Afshar Afshar replied 17 years, 4 months ago 1 Member · 1 Reply
  • 1 Reply
  • Afshar Afshar

    April 19, 2009 at 3:08 pm

    hello again

    I did some more thinkering and I think I’ve found a solution.

    gap = thisComp.layer("Null 1").effect("Slider Control")("Slider");
    startingPos = [ 0, 240, 0 ];
    //--
    dispVec = [thisComp.layer("Null 1").effect("xdepth")("Slider"), 0, thisComp.layer("Null 1").effect("zdepth")("Slider")];
    i = index - 10;
    startingPos + (i * gap * dispVec)

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