Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can’t get toWorld to work!

  • Can’t get toWorld to work!

    Posted by Paul Roper on February 2, 2011 at 7:55 pm


    So…I’m trying to get the world co-ordinates of the null which is parented to the line. The line pivots about its right end – no position change, just rotation. I want to get the world co-ordinates of the null (which goes up and down as the line rotates). I’ve got the following expression currently in a text layer to see what it produces…the values do not change as the line rotates. Any thoughts, please?

    I’ve tried swapping toWorld to toComp, fromWorld and fromComp just to see if anything happens, but no luck so far…the values remain constant.

    toWorld(thisComp.layer("null").transform.position)

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

    February 2, 2011 at 8:22 pm

    Try it this way:

    L = thisComp.layer(“null”);
    L.toWorld(L.transform.anchorPoint)

    Dan

  • Paul Roper

    February 2, 2011 at 9:15 pm

    Thank you Dan – it worked perfectly! Kinda seems odd that it works with the anchor point but not the position – but hey, problem solved.

    Thanks again for the fast response!

  • Dan Ebberts

    February 2, 2011 at 9:20 pm

    A parented layer’s position is relative to the parent’s layer space. To get toWorld() to work correctly, you need to start with something relative to the layer’s own space (like the anchor point).

    Dan

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