Jump to content
louderthan11

parent the position of a 3D light to the position of a 2D null object

Recommended Posts

I've got a 2D null object with motion tracking data applied to it. I need the position of a 3D light to follow the position of that 2D null object and show up correctly. Obviously, when I parent the position of the 3D light to the 2D null position---it doesn't align properly. I'm trying to figure out how to use an expression to convert the world space position of the 3D light to the comp space of the 2d null. (I think I am describing that correctly? I don't think I fully understand layer space vs comp space)

 

I tried searching the forums on mograph.org for this and I couldn't find a clear answer, if one at all. I've been digging through the interwebs for hours. Sorry If I missed a thread with the answer! Any help would be greatly appreciated! Thanks guys!

 

-Jordan

Share this post


Link to post
Share on other sites

Not sure what you are trying to say - it should align perfectly at Z position 0 within the boundaries of the layer as assumed to be resting at this position. Everything else involves a lot of hocus-pocus and assuming you're the same guy who posted this on VC, the answer is still the same: You're in for some ugly and bloated expression code that involves multiple conversions. Anyway, without more info on your setup, there's not much point in even starting to try and think about it...

 

Mylenium

Share this post


Link to post
Share on other sites

Yep, same guy. Trying to figure this out. Let me give some more info. I have a shot that I've tracked in 3D using camera tracker and created a scene with a camera. In that same shot I've used traditional 2D motion tracking to track a moving point and applied that tracking data to a null. I'm trying to parent the position of a light to follow the position of that null. If I make the null object 3D, it no longer aligns properly on my footage where I need it to. I am assuming that is because the null is in comp space and once I make it 3D it is in world space relative to the camera.

I'm assuming what I want to do is possible with expressions and layer space conversion methods. I've tried to figure it out but I'm not that good and could really use some help. I really appreciate it! Thanks for your responses in both forums Mylenium :)

Share this post


Link to post
Share on other sites

It seems like if I knew how to get a light object to use the same 2d comp space as my null object I could get this to work . . . is there a way to do that? From what I am learning/reading about expressions it seems like I would be able to do this with a layer space transform method. I'm just not sure how to write it out . . .

Share this post


Link to post
Share on other sites

Figured it out! After some more digging and discussion with smarter folks than I, here is how I pulled it off:

 

I made a 3D null object and applied this expression to the position:

 

L = thisComp.layer("2D Null"); //the null object with the tracking data

value + fromCompToSurface(L.position);

 

Then I parented the position of a 3D light to that 3D null and everything snaps and aligns perfectly with my 2d track point. I couldn't apply the expresion directly to the light because lights don't have anchor points.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×