Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position to null position

  • Position to null position

    Posted by Alex Dinnin on October 16, 2008 at 10:37 am

    Hey All,

    Is there an easier way to do this… I have a layer and a null, the null is at posx,y 360, 288 and then nulls position is at 260, 188. And I want to put an expression on the layers position so it STAYs in its original position but moves when the null does.. I would do this like this…

    x=thiscomplayer (“null1”)transform.position[0] – 100;
    y=thiscomplayer (“null1”)transform.position[1]null1.posy – 100;
    [x,y]

    What I want to know is there an easier way to do this.. it’s fine when there is only a 100 difference, as I can work that out nice and easy.. however it gets more complicated when it is 953.2.

    Is there something like value I could use or something that would work out the difference..

    it’s not the end of the world.. just hoping to better myself !!

    thanks

    Alex

    Dan Ebberts replied 17 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 16, 2008 at 1:19 pm

    Something like this should work:

    value + thisComp.layer (“Null 1”).transform.position – thisComp.layer (“Null 1”).transform.position.valueAtTime(0);

    You won’t notice anything until you animate the null’s position.

    Dan

  • Alex Dinnin

    October 16, 2008 at 2:01 pm

    thanks Dan,

    much appreciated .. just so I understand correctly

    we are adding the current value to the null, then taking the value at our current time and subtracting again to get the correct position.

    cheers

    Alex

  • Dan Ebberts

    October 16, 2008 at 2:11 pm

    To the pre-expression slave layer’s position, you’re adding how far the null has moved since frame 0.

    Dan

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