Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects get previous layer position value and offset

  • get previous layer position value and offset

    Posted by Andrea Marini on September 22, 2012 at 3:10 pm

    I need to offset each layer 500 px on the X axis from the previous layer. Is it possible to do something like (example) previouslayerinstackXvalue + 500 ?
    I’d like to do that so when I duplicate a layer it automatically offsets 500px away from previous layer.

    Thanks

    Andrea Marini replied 13 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • John Cuevas

    September 22, 2012 at 5:11 pm

    You could do it like this. Create a null and that will be your inital position. Add the layer you want to offset above the null layer in the layer stack and this expression:

    var offset = 500;
    x= thisComp.layer(index+1).transform.position[0]+offset;
    y= transform.position[1];
    [x,y]

    Now every time you duplicate that layer it will move 500 px to the right of the previous layer. Here’s an example project to check out: 4688_positionexpression.aep.zip

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • Andrea Marini

    October 6, 2012 at 7:41 am

    John, that is exactly what I was looking to. Thanks for your help!

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