Discussion:
Calculating the actual 2D position in a canvas of a 3D layer
(too old to reply)
D***@adobeforums.com
2006-11-28 19:19:11 UTC
Permalink
When working with a 3D comp in After Effects, does anyone know if it's possible to obtain the 2D position onscreen of a 3D layer (for example, a Null object)? I want to add a lense flare effect to a 3D comp and positioning information for the effect can only be supplied in X-Y coordinates (2D).

I imagine this could be achieved with Expressions, but so far I've not found any methods that seem to handle this kind of translation. My knowledge of 3D math is pretty minimal unfortunately. I'm hoping there's an inbuilt method somewhere. Any ideas?
P***@adobeforums.com
2006-11-28 19:45:31 UTC
Permalink
It isn't at all obvious. Here's an example of the expression:

the3Dlayer = thisComp.layer("Null 1");
the3Dlayer.toComp(the3Dlayer.anchorPoint);

It converts from layer space coordinates (which is why you use anchorPoint) to 2D comp coordinates Or you could apply an Expression Control > Point Control to the Null and use that instead:

the3Dlayer = thisComp.layer("Null 1");
the3Dlayer.toComp(the3Dlayer.effect("Point Control")("Point"));

It even works if your 3D layer is parented to something else.

Paul T
D***@adobeforums.com
2006-12-01 19:18:31 UTC
Permalink
Thank you very much for that - I'll give it a whirl now!

Loading...