Copy link to clipboard
Copied
Hey Folks. I'm writing an AE Effect Plugin that will draw a border inside the edges of the layer that it's applied to. This works great for Solid layers. However, when I apply the effect to a text or shape layer, my effect draws a border around the entire composition. The PF_EffectWorld passed into my render function has the same dimensions as the entire composition.
How can I determine the bounds of the text or shape layer that the effect is applied to? I basically want to draw a rectangle that has the same bounds as the selection box drawn by AE. I attached a photo that shows what I'd like to do.
Thanks for your help.
Copy link to clipboard
Copied
collapsed layers don't have a size and are actaully the same size as the comp. text and shape layers are such layers by default.
you can scan the input buffer for non 0 alpha pixels and get the image's bounding box.
but i think you'll get the input buffer post-transform (again, collapsed layers), so you'll need to manually take the layer's tansform into account if you wish the frame to follow layer transformation. that, however, is counter to the AE logix as effects on colapsed layers are generally expected to apply in comp coordinates and not layer coordinates.
Copy link to clipboard
Copied
Use the sourceRectAtTime Expression Method. This works for scripts and I assume they should work for plugins as well. HTH
Copy link to clipboard
Copied
I had this same question and Shachar had a good idea to use the vertices to find the bounds:
PF_PATHDATASUITE1 PF_PathVertexInfo
Not sure if this would also work on text, but would be more convenient if it does work:
AEGP_GetLayerMaskedBounds