How to get the visible bounds of a layer set (group)?
Hello world!
I'm writing a simple script where I need the bounds of the visible portion of the active layer (i.e. the bounds after the mask is applied).
Thankfully, the ArtLayer.bounds property gives you exactly that for any given layer.
However, if the active layer is actually a group (layer set), things get complicated.
First of all, the group's mask effect is completely ignored.
And second, the visibility state of the layers is being ignored as well.
So my question is: how do I get the bounds of the visible portion of a layer set (group)?
Or at the very least, how do I get the bounds of the group's mask? If I have that, I can iterate through all the group's visible layers bounds and intersect all of them with the mask bounds to get what I need.
I didn't find any methods or properties in the reference guide that could give me either of those.
And one bonus question: how can I find out if the active layer is an ArtLayer or LayerSet?
Any help would be appreciated!
Thanks!
