Copy link to clipboard
Copied
Hi gang!
Hope everyone is doing well.
I have a relatively simple question this time: what is the best approach to get the mask size within a layer?
By that, I mean the extents of the mask? So if I have a composition that is 1920x1080 and I have drawn a circle mask in it, with a size of 255x255, that is the size that should be reported.
I know I could read the mask and then loop through all the vertex positions to record the minimum and maximum x & y but is there a simpler (and less intensive) process than that?
Thanks in advance!
-Rich
This should do the trick and it returns in floating point precision:
Copy link to clipboard
Copied
No.
Mylenium
Copy link to clipboard
Copied
going through the vertices is the fastest way i know of.
Copy link to clipboard
Copied
I think these days, with Track Mattes able to be reused and not having to be directy above a layer, if I need to know a circular masks size, I'd be tempted to use a shape layer as a track matte. This gives me all the transform properties and allows for easier changing etc... If you're using a mask for effects (as opposed to cutting out), you might still be able to get away with a track matte with an adjustment layer, but that all depends on the context.
Copy link to clipboard
Copied
This should do the trick and it returns in floating point precision:
Copy link to clipboard
Copied
Hi James!
Thanks for your helpful reply. After some research I was able to successfully use GetMaskedBounds to get the mask extents. Certainly much easier (and faster) than looping through all the verts!
Thanks again,
Richard
Find more inspiration, events, and resources on the new Adobe Community
Explore Now