Activity › Forums › Adobe After Effects Expressions › How can I parent the position of a 3D light to the position of a 2D null?
-
How can I parent the position of a 3D light to the position of a 2D null?
Posted by Jordan Shipman on March 13, 2012 at 2:18 amI’ve been able how to figure out how to do the reverse–parenting the position of a 2D null to a 3D object using this expression:
X = thisComp.layer(“3D Layer”);
X.toComp(X.anchorPoint);But I need to parent the position of a 3D light to a 2D null object. I’m reading as much as I can right now on expressions. Can anyone help me out with an expression/explanation?
And thankyou Dan Ebberts for motionscript.com! I’m learning a lot so far! As seen above 🙂
-Jordan
Juan Salvo replied 14 years, 3 months ago 3 Members · 19 Replies -
19 Replies
-
Juan Salvo
March 13, 2012 at 2:42 amI don’t think this would be possible unless you are doing it on a fixed z plane. There is the extra variable in 3d space that doesn’t exist in 2d.
-
Jordan Shipman
March 13, 2012 at 9:27 pmI understand. I think there is a way to do it using expressions and layer space transform methods. I’m just not good enough with expressions to figure out how to make it work.
-
Juan Salvo
March 14, 2012 at 2:43 amI believe the layer space transform only goes 3d to 2d. Like I said 3d adds an extra variable. So a single point in 2d space can actually be many different points in 3d space.
-
Jordan Shipman
March 14, 2012 at 2:53 amI see what you are saying. I don’t know if this would make a difference–the Z coordinate doesn’t need to change. It can remain constant. But lets say when I manually copy the X and Y values for the 2D null object over to the 3D light and manually set the Z coord for the light–things still don’t line up. Is that because the 2d null is in comp space and the light is in world space? Is there a way to get them to line up?
-
Juan Salvo
March 14, 2012 at 3:05 amIs that because the 2d null is in comp space and the light is in world space? Is there a way to get them to line up?
Yep. That is why. Also because the x,y,z coordinates are in absolute value not relative. So moving 10increments over in the x space does not translate to the 10pixel move in 2d space, due to the distance in z.
Can you convert your null to 3d?
What exactly are you trying to do?
-
Jordan Shipman
March 14, 2012 at 4:16 amOk, so I have some footage shot on a dolly. I tracked the shot inside after effects using camera tracker and set up a scene. So I have a camera with keyframes. The camera in AE is moving. Using the track points from camera tracker, I created 3D null objects which I then swapped out for lights at the exact same position of the null objects using a script. I’m using plexus with a lights object to create some designs. Now, in that same tracked shot–I’ve used traditional 2D motion tracking inside of AE to track a moving point in the shot and applied that 2D tracking data to a null object. I want to get a 3D light to align with the position of that 2D null object so I can use it to interact with my plexus lights object. If I make the 2D null 3D, then it does not align on my tracked point properly relative to the camera in world space. Only when it is in 2D comp space does it align on my tracked point the way I need it to. If I can get that 3D null to align in world space relative to the camera the way it lines up in 2d comp space, I would be golden. Does all this make sense? Thanks for your help so far!
-
Juan Salvo
March 14, 2012 at 4:25 amYou need a 3d tracker. This one is good and has a 15 day trial. But there are many others.
https://www.thefoundry.co.uk/products/cameratracker/
You’ll need to use it’s camera solution. Not your existing camera. But you should be able to track your object within that.
Option two is to manually track in pseudo 3d. It’s tough to get a 3d move of an object moving within a 3d scene.
-
Jordan Shipman
March 14, 2012 at 4:36 amI have camera tracker and thats what I used to track the shot. You can’t manually set track points with camera tracker (as far as I know). I am using the camera created with camera tracker . . . maybe I’m not explaining this well. The camera in after effects is the one produced by cameratracker when I tracked the shot. Because I can’t manually set track points or control them with cameratracker, I had to manually set a motion tracking point in the shot using the built in after effects tools, and then applied that tracking data to a 2d Null object. I need a 3D light object to follow the position of that 2D null object, one way or another so I can get that point to interact with plexus in the shot the way I want it to. Does that make more sense? Ultimately, I need to get a 3D light to follow the position of a 2D null, and I don’t need that 3D light to follow the Z position of anything. It just needs to align properly in the same x and y comp space as the 2D null object, rather than align in world space. Or maybe there is some other way to pull it off. Does this make more sense?
-
Juan Salvo
March 14, 2012 at 4:58 amWell the 2d tracker isn’t going o give you a 3d location to null to. Are there any tracked points that coincide in space with the object you want to track? If you can find a point in your ae world that matches a point where the object passes, and the object is moving smoothly… Then you should be able to hand track the object in 3d space. I used to use matchmover pro which let you add tracking points manually in addition to automatically and include them in your scene. Thereby enabeling this. A true 3d track of an object moving independently of camera isn’t possible in any way I can think of in ae. Manually may be the only way.
-
Jordan Shipman
March 14, 2012 at 5:26 amWell I don’t think it has to be a true 3d track of an object. As long as I can get a 3d object to follow a 2D point, i can do what I need to do. Is there no way to get a 3D object in after effects to behave like a 2D object in comp space? It seems like you should be able to do that with the layer space transform functions but I’m just not sure exactly how they work.
Reply to this Discussion! Login or Sign Up