Creative COW SIGN IN & SETTINGS :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Linking Parented Layers Postion

Cow Forums : Adobe After Effects Expressions
Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 6:00:06 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!

Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Dan Ebberts on May 17, 2008 at 4:50:03 pm

This should do it:

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

Dan



Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 7:38:57 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!



Respond to this post     Return to posts index


Re: Linking Parented Layers Postion
by Dan Ebberts on May 17, 2008 at 7:58:51 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



Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 8:14:36 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

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


Any ideas?


Thanks again!



Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 8:19:40 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!



Respond to this post     Return to posts index


Re: Linking Parented Layers Postion
by Dan Ebberts on May 17, 2008 at 9:11:23 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



Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 10:59:42 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!



Respond to this post     Return to posts index

Re: Linking Parented Layers Postion
by Mike Moser on May 17, 2008 at 11:28:00 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?





Respond to this post     Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSLIBRARYPODCASTSBLOGSMAGAZINESERVICESNEWSLETTERSNEWSSTOREEVENTS

© CreativeCOW.net All rights are reserved.

[Top]