Copy link to clipboard
Copied
I'm using `sAIMatchingArt->GetMatchingArt` with a type of `kGroupArt`. I'm only interested in group objected, but this also gives back layers. What's the best way of working out if something is a group and not a layer?
There's a function, AIArtSuite::IsArtLayerGroup that returns true if the group is a layer, and false if it's just a group.
Copy link to clipboard
Copied
That issue is a little bit of an ugly one.
We have a function which determines wether a group is a layer group by simple fetching all art from a layer and checking if the art object in question is the first art object of that layer. If yes it is the layer group art.
You can get all art of a layer when you have an AILayerHandle:
AIArtSet layerArt(nullptr);
sAIArtSet->NewArtSet(&layerArt);
sAIArtSet->LayerArtSet(layer, layerArt);
Copy link to clipboard
Copied
There's a function, AIArtSuite::IsArtLayerGroup that returns true if the group is a layer, and false if it's just a group.
Copy link to clipboard
Copied
Excellent, this works just like I need.
Copy link to clipboard
Copied
Ouch. That's the kind of path I was starting to head down. It looks like the answer from A. Patterson might be handy for you as well.
Copy link to clipboard
Copied
Well it still works
But good to know there is a dedicated function for this - seems I overlooked that.