Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking Parented Layers Postion

  • Linking Parented Layers Postion

    Posted by Mose on May 17, 2008 at 6:00 am

    Hello, I’m a newbie and need some help with a expression..

    I’m need to link a point light’s 3d position to a parented layers 3d position.

    Or possibly a way to create a motion path from a parented layers position.

    Thanks in advance!

    Mose replied 18 years ago 2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    May 17, 2008 at 4:50 pm

    This should do it:

    L = thisComp.layer(“your parented layer”);
    L.toWorld(L.anchorPoint)

    Dan

  • Mose

    May 17, 2008 at 7:38 pm

    Thanks Dan!

    But it’s not working, the parented layer is actually a pre-comp.

    So I should have said that I need help linking a light to a parented pre-comps 3d position.

    Any ideas?

    Thanks again!

  • Dan Ebberts

    May 17, 2008 at 7:58 pm

    Hmmm… it should still work, unless what you really mean is that you want to position the light on a layer that’s inside the parented precomp.

    Dan

  • Mose

    May 17, 2008 at 8:14 pm

    Thanks Dan!

    the parented layer is actually a pre-comp.

    So I should have said that I need help linking a light to a parented pre-comps 3d position.

    I tried modifiying your suggestion to

    L = thisComp.layer(“Plane red ball”);
    L.toWorld(L.anchorpoint)

    It tracks but the alignment is off.

    Basicly, I’m trying to create a Indiana Jones Map
    and this is what I have done:

    Create a path, attach a solid and orient along path.
    Parent a pre-comp’d Plane layer (which tracks perfectly).

    My issue comes when I try and parent a light to use as a emitter for particular.The alignment shifts. I need the alignment perfect as it needs to leave a trail from the tail of the plane.

    I know I’m doing something wrong but can’t figure it out since my plane layer is perfect.

    Here is just the project with plane with track file if you can have a quick look: 1.2mb

    https://finalphasedvd.com/download/Jones%20Map%20Track%20Help.zip

    Any ideas?

    Thanks again!

  • Mose

    May 17, 2008 at 8:19 pm

    “unless what you really mean is that you want to position the light on a layer that’s inside the parented precomp.”

    Yes this might be what I need!

  • Dan Ebberts

    May 17, 2008 at 9:11 pm

    Yup. It looks like you really want to track the “red ball” layer inside the parented “Plane red ball” comp.

    There are a couple of problems. One is that the red ball is masked section of a comp-sized layer that is offset from the layer’s anchor point. So, I would add a null (“Null 1”) in the “Plane red ball” comp positioned at the center of the red ball.

    The other problem is that you have the emitter light parented, so you need to undo that.

    Then you can add this expression to the light’s position:

    L = comp(“Plane red ball”).layer(“Null 1”);
    CL = thisComp.layer(“Plane red ball”);
    CL.toWorld(L.toWorld(L.anchorPoint));

    Dan

  • Mose

    May 17, 2008 at 10:59 pm

    Perfect, your Amazing! That makes alot of sense now that I see my mistake.

    Last hurdle now is trying to get the particle stream to orient with the camera, I think orientation or rotation was being controlled before by parenting the light to the plane layer, now they are following from the tail, but not rotating.

    Thanks again!

  • Mose

    May 17, 2008 at 11:28 pm

    another thought:

    is there a way to create a path from the plane ball so I can align to the path in particular or assign a stroke?

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