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?
Juan Salvo replied 14 years, 3 months ago 3 Members · 19 Replies
-
Juan Salvo
March 14, 2012 at 1:34 pmNot if you want the 3d light to interact with a 3d object (plexus) while existing in a 3d world and affected by a 3d camera. In that case you need to position the like inside of 3d space not 2d. I will say that if you aren’t using lux or other plugin to make the light visible then you have a lot of forgivenesss for the position of the light. So hand positioning it should work.
-
Jordan Shipman
March 14, 2012 at 3:34 pmWhat if the light doesn’t have to interact with a 3D object in a 3D world affected by a 3D camera? What if I just want the light to use the same comp space as the 2D null? Essentially I would be making a 3D light “2D.” But it would still be a “light” object. Is this possible? That seems easier! Thankyou so much for your time and help.
-
Dan Ebberts
March 14, 2012 at 6:58 pmSorry to jump in late on this, but I think you just need the seldom-used fromCompToSurface() transform. Try this for your light’s position:
L = thisComp.layer(“Null 1”); // your 2D null
value + fromCompToSurface(L.position);Dan
-
Jordan Shipman
March 14, 2012 at 7:50 pmThanks fo the response Dan! Hopefully I can get somewhere with this.
here is what I typed in on the lights position:
L = thisComp.layer(” My Null”);
value + fromCompToSurface(L.position);After effects gives me this error:
Couldn’t project comp point onto layer in fromCompToSurface
Any thoughts?
Thanks for your help?
-
Dan Ebberts
March 14, 2012 at 8:20 pmAh yes. That’s probably because a light doesn’t have an anchor point. Can you put a 3D null at the same position as the light, parent the light to the null, and apply the expression to the null?
Dan
-
Juan Salvo
March 14, 2012 at 8:41 pmThat’s a clever work around Dan. But won’t that stop working when the cameras z position moves?
-
Dan Ebberts
March 14, 2012 at 8:43 pmI would expect it to work since the comp view is the camera view, but you’d have to try it to be sure.
Dan
-
Jordan Shipman
March 14, 2012 at 9:10 pmYES! AWESOME! Works perfectly the way I need it to! Thankyou so much Dan!!!! And thankyou for your help as well Juan! I really appreciate it!
-
Juan Salvo
March 14, 2012 at 11:29 pmDan deserves full credit. That was a very clever workaround he came up with.
Reply to this Discussion! Login or Sign Up