Skip to main content
Participant
November 22, 2020
Answered

How to get layer transform data in plugin?

  • November 22, 2020
  • 1 reply
  • 793 views

Greetings all,

 

I have a normal pixel processing effect that creates grain on my image/video. Now want to read the layer's position, anchor, and scale so I can use in some calculation. How can I read this information?

 

Kindly, all your help is appreciated!

This topic has been closed for replies.
Correct answer shachar carmi

if you want to get the layer's numeric transform values, use AEGP_GetNewLayerStream to get the param's stream and AEGP_GetNewStreamValue to retreive it's numeric value.

 

however, that might not be too helpful if you need all of the layer's transformations in the comp, including parenting or event camera movement which affects layer position on screen.
if that's what you need, then AEGP_GetLayerToWorldXform mixed with the camera matrix would be the way to go.

1 reply

shachar carmiCommunity ExpertCorrect answer
Community Expert
November 22, 2020

if you want to get the layer's numeric transform values, use AEGP_GetNewLayerStream to get the param's stream and AEGP_GetNewStreamValue to retreive it's numeric value.

 

however, that might not be too helpful if you need all of the layer's transformations in the comp, including parenting or event camera movement which affects layer position on screen.
if that's what you need, then AEGP_GetLayerToWorldXform mixed with the camera matrix would be the way to go.

Participant
November 23, 2020

Thank you for the assistance!

 

I did some extra thing to finally get this to work (for anyone who reads this later and needs assistance)

 

First I got AEGP_PluginID during GlobalSetup(). I think this is required for many AEGP methods.

 

Then using your help I got several other values to final get a Transform value. In this case I get the position and put it in the streamValue variable.

 

Thanks again @shachar carmi !