Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Layer space / Comp space / World space

  • Layer space / Comp space / World space

    Posted by Terry Coolidge on October 23, 2016 at 4:35 am

    I know enough to know that I can use expressions to accomplish what I want, but I don’t use them often enough to know how exactly to do it. I have an image of a map as a layer (could be in a precomp, but doesn’t have to be), and I have a number of pushpin graphics as individual layers. I want to zoom in and out on the map, and I want the points of the pins (the anchor points) to remain “locked” to their respective locations on the map, even if the map scales up so much that some pins go it of frame. However, I want the pins to remain constant in size. I do not want the pins to scale.

    My preference would be to have the map be a 3D layer so that I can actually zoom in 3D space rather than manipulating the scale of the map to create a zoom effect. I’m fairly confident that expressions driving the position of 2D pins can handle either scenario, but I’m open to suggestions. I know this involves converting coordinates to/from layer space, comp space, and potentially world space, but as I mentioned, I don’t know enough to figure this out on my own. I understand the concepts in an abstract way, but I’m afraid I would spin my wheels quite a bit before ever reaching the proper solution. Any help will be greatly appreciated. Thank you!

    Roei Tzoref replied 9 years, 6 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    October 23, 2016 at 6:52 pm

    I think the easiest might be if you had nulls parented to the map where you want the pins to be. Then you could use something like this on the pins:

    L = thisComp.layer(“Null 1”);
    L.toWorld([0,0,0])

    Dan

  • Terry Coolidge

    October 23, 2016 at 7:09 pm

    Hi Dan,

    I was just logging in to post a follow-up when I saw your reply. Thank you very much. This is exactly what I did. I placed a 3D null at the point of each 2D pin, and then parented the nulls to the 3D map layer. I then used “toComp” to have each pin refer to the position of its corresponding null. Works beautifully. Thanks for taking the time to respond. Nice to have confirmation that I didn’t come up with some screwy solution.

    – Terry

  • Roei Tzoref

    October 23, 2016 at 7:50 pm

    Hi Dan. Why would you use toWorld when toComp accomplishes the 3D location to corrosponding 2D without parenting? What Op eventually did I think…
    Thanks

    Roei Tzoref
    After Effects Artist & Instructor
    ♫ Ae Blues Tutorials

  • Dan Ebberts

    October 23, 2016 at 8:06 pm

    Good question. I wasn’t sure whether the pins would be 2D or 3D, just that they shouldn’t scale with the map.

    Dan

  • Roei Tzoref

    October 23, 2016 at 10:05 pm

    Thank you.

    I understand (sort of) that toComp is transforming a point from layer space to comp space. Thus making it possible to have a 2D layer follow a 3D layer that reacts to a 3D Camera: https://www.motionscript.com/mastering-expressions/lst-lens-flare.html, but in what practical situation would you need toWorld? Is this a way to make a 3D layer not to be bound by comp space (camera). In layman terms please 🙂

    Roei Tzoref
    After Effects Artist & Instructor
    ♫ Ae Blues Tutorials

  • Dan Ebberts

    October 23, 2016 at 10:35 pm

    > Is this a way to make a 3D layer not to be bound by comp space…?

    Exactly. Use it when you want a 3D layer to end up at a specific spot in 3D space. Useful, for example, if you need to match the position of a parented 3D layer.

    Dan

  • Roei Tzoref

    October 23, 2016 at 11:22 pm

    Thanks. I will experiment with this and hopefully wii wrap my head around it eventually.

    Roei Tzoref
    After Effects Artist & Instructor
    ♫ Ae Blues Tutorials

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