Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change shape layer space to comp space

  • Change shape layer space to comp space

    Posted by Topher Blair on November 20, 2015 at 1:21 am

    I’m very new to writing expressions in After Effects, and I don’t have any real coding experience outside of After Effects. I am trying to create multiple shapes inside of a single shape layer, then parent each of them to different null objects so that I can use the nulls to control the positions of each shape. I’ve gotten the nulls to control the position, but they’re using two different reference frames – the nulls express their positions in Comp space, and the shapes express their positions in layer space.

    Is there a way to convert the layer space for the shapes into comp space so that the shapes always line up with where the null is in the comp? Or possibly a way to covert the comp space for the nulls into the shape layer’s layer space?

    I’ve looked at Carl Larsen’s videos and I feel like they almost get me where I’m going, but not quite.

    Thanks!

    Topher Blair replied 10 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 20, 2015 at 2:40 am

    Like this, probably:

    L = thisComp.layer(“Null 1”);
    p = L.toComp(L.anchorPoint);
    fromComp(p)

    Dan

  • Topher Blair

    November 20, 2015 at 5:13 pm

    That did it!
    Thank you!

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