Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Access position of parented null

  • Access position of parented null

    Posted by Dann Parks on December 23, 2020 at 5:51 pm

    I need to access the position of a parented null (in 3D space). The parented null has an anchor point offset from the parent null, and the parent is aligned and moving on a curving 3D path (so the parented null’s position path is parallel to, but different from the parent).

    I want to tie a MIR object to the parented null position, but the parented null position reads zero. I’ve tried a “From World” to try to access the parented null hoping that was an easy fix, but no. Is there a simple way to access a parented null’s position when it is separated from its parent?

    Thanks for any help.

    Dann Parks replied 5 years, 9 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    December 23, 2020 at 6:01 pm

    Try it this way:

    L = thisComp.layer("Null 1");

    L.toWorld(L.anchorPoint)

  • Dann Parks

    December 23, 2020 at 7:30 pm

    Thank you, Dan. My script knowledge is rudimentary, so I’m working to figure out how that script works and what it is acting on.

    It picks up the position of Null 1 (the child), but not the anchor point offset that I have put into Null 1. So essentially it is picking up the position of the original parent.

  • Dann Parks

    December 23, 2020 at 8:11 pm

    Some success. I tried some half-educated guesses (and more digging in your website) and tried:

    L = thisComp.layer(“Null 1”), anchorPoint;

    L.toWorld(L.position)

    This seems to work. Don’t know exactly why – yet.

  • Dan Ebberts

    December 23, 2020 at 9:30 pm

    What I posted should give you the location of the parented null’s anchor point in world space. I guess I don’t completely understand what you’re after. Maybe you could post a screen shot of how you have things set up.

  • Dann Parks

    December 23, 2020 at 11:30 pm

    Thank you, Dan. What you gave me (tweaked) is working perfectly. Here are some test screens of what I’m doing. It’s more complex than I described as I tried to keep the description simple. It is VR180 animation of three “ships” flying through clouds and around a larger “mothership”. The center ship (and the stereo cameras) is following a 3D path (the parent), but the wingman ships needed the offset, and they also need to bank together in formation (rotating the master Null causes them to bank). The MIR ship objects (as well as the Particular trails) are using that code to connect to individual Nulls with the offset. Probably not explained very well, but it’s all working great (so far).

    This is all in a custom VR180 stereo camera rig designed for VR headsets.

    Thanks again for your help.

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