• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to tell the difference between a group and a layer?

Community Beginner ,
Jun 17, 2019 Jun 17, 2019

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?

TOPICS
SDK

Views

710

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

correct answers 1 Correct answer

Guide , Jun 18, 2019 Jun 18, 2019

There's a function, AIArtSuite::IsArtLayerGroup that returns true if the group is a layer, and false if it's just a group.

Votes

Translate

Translate
Adobe
Explorer ,
Jun 18, 2019 Jun 18, 2019

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);

Votes

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
Guide ,
Jun 18, 2019 Jun 18, 2019

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.

Votes

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
Community Beginner ,
Jun 18, 2019 Jun 18, 2019

Copy link to clipboard

Copied

Excellent, this works just like I need.

Votes

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
Community Beginner ,
Jun 18, 2019 Jun 18, 2019

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.

Votes

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
Explorer ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

LATEST

Well it still works

But good to know there is a dedicated function for this - seems I overlooked that.

Votes

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