Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple X and Y offset

  • Simple X and Y offset

    Posted by Greg Howell on May 8, 2016 at 5:31 pm

    Hi Guys,

    I’ve parented the positional value from object A to follow the positional value of object B. As well as follow its position, I would like to offset the x value by an additional 100px and the y value by an additional 50px. What would be the expression needed to achieve this?

    thanks,

    Greg

    Dan Ebberts replied 3 years, 5 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    May 8, 2016 at 6:11 pm

    Something like this should do it:

    thisComp.layer(“object B”).transform.position + [100,50]

    Dan

  • Greg Howell

    May 9, 2016 at 5:50 pm

    This works. thanks Dan!

  • Eduardo Asta

    December 6, 2022 at 8:15 pm

    Hello Dan,

    Do you know how to offset the position of parented layers using an incremental value? Like, 1st layer 100px off, 2nd layer 110px, 3rd layer 120px…

  • Dan Ebberts

    December 6, 2022 at 10:28 pm

    What do you mean by “1st layer”, “2nd layer”, etc.?

    If you mean that you have a chain of parented layers and you want each one farther down the chain to have more offset, you could do something like this:

    L = thisLayer;
    offset = 100;
    while(L.hasParent){
    offset += 10;
    L = L.parent;
    }
    value + offset

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