Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How to get the bounds of text or shape layer?

Explorer ,
Mar 26, 2021 Mar 26, 2021

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.

TOPICS
Error or problem, SDK

Views

86

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 26, 2021 Mar 26, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 27, 2021 Mar 27, 2021

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


Motion Graphics Brand Guidelines & Motion Graphics Responsive Design Solutions
Development | Consulting | Training

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 04, 2021 Apr 04, 2021

Copy link to clipboard

Copied

LATEST

I had this same question and Shachar had a good idea to use the vertices to find the bounds:

PF_PATHDATASUITEPF_PathVertexInfo

 

Not sure if this would also work on text, but would be more convenient if it does work:

AEGP_GetLayerMaskedBounds

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines