Jump to content
Sign in to follow this  
monomind

Group Node: Base group -- how to check if prim is in multiple?

Recommended Posts

Trying to figure out how to check if a selected prim is in multiple base groups.

I believe what I'm looking for is an "and" equivalent for the "base group" input field

Share this post


Link to post
Share on other sites

Given that it involves detecting selected prims for attribute filtering, might want to shift this question to the scripting section of the forum

Share this post


Link to post
Share on other sites

you can do this in Primitive Wrangle

string allprimgroups[] = detailintrinsic(0, "primitivegroups");
foreach(string grp; allprimgroups){
    if (inprimgroup(0, grp, @primnum)){
        append(s[]@primgroups, grp);
        i@ngroups++;
    }
}

it will create 2 attributes:

primgroups - array of all group names the primitive belongs to

ngroups - number of groups that primitive belongs to (so if this is 2+ it belongs to more than 1 group)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×