Skip to main content
Known Participant
January 7, 2020
Question

After Effects SDK - is there a "toComp" method for plug-ins?

  • January 7, 2020
  • 2 replies
  • 873 views

The AE plug-in i'm developing uses a 2D API to draw a simple vector shape based on an attached mask.  The plugin can adjust the shape's position using slider input which simply moves the path points up and down.

 

It works fine on a 3d layer, however when "continuosly rasterize" is enabled, the offsets are applied in comp space not layer.

 

Is it possible to convert the points from layer space to comp and back?

 

In expressions I can simply use theLayer.toComp([100,100]) to get the equivalent comp coordinates of point [100,100] on theLayer.

 

Can we do this in the SDK?  I found AEGP_GetEffectCameraMatrix which looks like the right start, but not sure how to use it.

 

Also is it easy to calculate the distance between a point in layer space and the camera?

 

Always appreciate any help or advice,  thanks!

This topic has been closed for replies.

2 replies

Community Expert
January 11, 2020

ugh... if it's only for the sake of drawing on a collapsed layer, don't go down the "toComp" route... it's possible, but it takes a lot of work to set up.

you should probably look at the input world rectange or buffer offest. these would tell you how much to offset your output by.

Known Participant
January 11, 2020

thanks Shachar,, yes it seems like too much work so I'll try your great suggestion 🙂

James Whiffin
Legend
January 9, 2020

Hi James
When you say the offsets are applied in comp space not layer, are you referring to the user defined offsets from your slider param?

Known Participant
January 10, 2020

Hi James, yes the user defined param values become applied in comp space.  I'm doing something similar to your Cairo tutorial but sadly it won't work on a continuously rasterized layer :'(