Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Attach Corner Pin points to another layers corners with expression

  • Attach Corner Pin points to another layers corners with expression

    Posted by Liam Campbell on October 27, 2016 at 4:49 pm

    I’m trying to connect the corner pins of one layer to the corners of another layer with expressions so that if I scale or move the second layer, the corner pins will be locked to the corners. I’m trying to find a way to access the corner coordinates to attach the 4 corner pins to?

    Thanks!

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

    October 27, 2016 at 6:12 pm

    Here are a couple of examples. This is for the Upper Left corner:

    L= thisComp.layer(“Other Layer”);
    fromComp(L.toComp([0,0]))

    This is for the Lower Right:

    L= thisComp.layer(“Other Layer”);
    fromComp(L.toComp([L.width,L.height]))

    You should be able to work out the other two.

    Dan

  • Liam Campbell

    October 27, 2016 at 6:41 pm

    Thank you, works perfectly, could you please explain what the different parts of the expression do just for my own clarification and understanding?

    Thanks!

  • Dan Ebberts

    October 27, 2016 at 6:50 pm

    Basically it just converts the target layer’s corner coordinates to comp space, then converts those comp space coordinates into the Corner Pin layer’s local coordinate system (which is what the corner properties need).

    Dan

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