Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expressions: inverting X and Y position

  • expressions: inverting X and Y position

    Posted by Vincent Janssen on May 21, 2008 at 9:19 pm

    hello. I’m having difficulties with some expressions. Can anybody help me out please?
    This is the problem I have:

    I have a layer in a comp that is not centred but slightly transformed to the right. Also with the height (y). Now I want to use expressions to define the new position of that layer. The amount it peaks out to the right must be inverted so it peaks out to the left with the same amount! Again also for the height.

    I used this code:

    thisComp.width-thisComp.layer(“fiets rit sequence.mov”).transform.position;
    thisComp.layer(“fiets rit sequence.mov”).transform.position-thisComp.height;

    but it doesn’t work. Although, only the first rule does work. So how do I implement these 2 rules to one good one? Or am I completely wrong and do I have to use a different code?

    I hope anyone can help me out because I have a deadline… 🙁

    Great thanks in advance!!

    Vincent Janssen replied 17 years, 12 months ago 2 Members · 3 Replies
  • 3 Replies
  • Lloyd Alvarez

    May 21, 2008 at 10:11 pm

    Try this:

    x=thisComp.width-thisComp.layer(“fiets rit sequence.mov”).transform.position[0];
    y=thisComp.layer(“fiets rit sequence.mov”).transform.position[1]-thisComp.height;
    [x,y]

    _lloyd

    https://aescripts.com

  • Vincent Janssen

    May 21, 2008 at 10:15 pm

    great thanks for your reply!

    But it doesn’t work. Now it sets my layer on above my comp. And I want the difference in y to be compensated to the other side. So if my layer is 5 px over the edge on the top, it must be 5 px over the edge on the bottom.

    Thanks for your help!

  • Vincent Janssen

    May 21, 2008 at 10:36 pm

    this one does the trick!

    x=thisComp.width-thisComp.layer(“fiets rit sequence.mov”).transform.position[0];
    y=576-thisComp.layer(“fiets rit sequence.mov”).transform.position[1];
    [x,y]

    great thanks for your help!

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