Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expression to make objects spread away in z-space

  • expression to make objects spread away in z-space

    Posted by Tim Garber on August 7, 2021 at 10:24 pm

    So I have 21 layers that need to move away from each other proportionately in z-space. They all start off the same size so setting them up on different planes and using the camera doesn’t work. I can move each layer but ideally what I’d like to do is move one layer and have them all move proportionately away from each other.

    Expressions are a foreign language I learn bits and pieces of as needed and unfortunately I quickly forget what I don’t write down and I recall in the past using one similar on an X-axis animation years ago.

    Thank you.

    Chris Voelz replied 5 years ago 2 Members · 2 Replies
  • 2 Replies
  • Tim Garber

    August 7, 2021 at 10:42 pm

    This is how I think it should look but it doesn’t work. By the time I get to layer 21, it’s in another galaxy.

    z=thisComp.layer(index+1).transform.position[2]*10;
    [1920,1080,[z]];

  • Chris Voelz

    August 7, 2021 at 11:14 pm

    Don’t multiple by 10. The further each layer gets back the bigger the difference between them. If you’re okay with the spacing being the same add (+) a number.

    ….position[2] + 100

    For each layer down it will move it back in z space by 100 pixels.

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