Copy link to clipboard
Copied
Hey,
I am trying to retrieve the final coordinates of the four footage layer's corners (top-left, top-right, bottom-right, bottom-left) as they appear on the rendered output for every single frame. I am able to read the layer's position, rotation, scale etc. with
layer.property("position").valueAtTime(...)
But when combining these with a specific anchor point and/or additional effects or when having parent layers things become more tricky. Instead of reading these values individually and re-apply the computation AE already does, I'd like to have a transformation function that could project coordinates from the source footage space into the final composition panel's space. In AE Expressions I can see a toWorld() and toComp(). Is this what I am looking for? How can I invoke those from Scripting then?
Any help appreciated.
Regards,
Heiko
Copy link to clipboard
Copied
Unfortunately, all that expressions layer space transform goodness doesn't exist in the scripting world. The easiest way to do it might be to have the scipt apply a slider to which it then applies the appropriate expression, for each dimension and each corner and harvest the result each time. So you'd apply the slider, apply the 12 expressions (reading the value each time) and delete the slider. If everything is 2D, you could use a point control and only have to apply 4 expressions (one for each corner).
Dan
Find more inspiration, events, and resources on the new Adobe Community
Explore Now