how to select not in group to other group use simple way

   4060   5   0
User Avatar
Member
11 posts
Joined:
Offline
have much groups(maybe group1,group2 to group100),and i want to select prims not in group to other group,

if use group combine,i have to type group1,group2,…. to group100,It's like a joke.

so wirte vex in attribwrangle

————————————————————-
string mygroup = detailintrinsic(0, “primitivegroups”);

int sss = len(mygroup);

for(int i=0;i<sss;i++)
{if (!inprimgroup(0,mygroup,@primnum))

{setprimgroup(0, “ss”, @primnum, 1);}
}
————————————————————-
it works,but houdini have other easy way to do it?
User Avatar
Member
9380 posts
Joined: July 2007
Offline
to group everything that is not in group yet you can create Group SOP and in the Base Group type:!?*


darkdark132
have much groups(maybe group1,group2 to group100)
this can be very inefficient, if your groups don't need to overlap consider using attributes instead
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
11 posts
Joined:
Offline
tamte
to group everything that is not in group yet you can create Group SOP and in the Base Group type:!?*


darkdark132
have much groups(maybe group1,group2 to group100)
this can be very inefficient, if your groups don't need to overlap consider using attributes instead

thanks, !?* can be use in any group like SOP?
User Avatar
Member
11 posts
Joined:
Offline
tamte
to group everything that is not in group yet you can create Group SOP and in the Base Group type:!?*


darkdark132
have much groups(maybe group1,group2 to group100)
this can be very inefficient, if your groups don't need to overlap consider using attributes instead

and,i find a bug in attribuewrangle:

string magroup = detailintrinsic(0, “primitivegroups”);
int sss = len(magroup);
setprimgroup(0, “ss”, @primnum, 1);

for(int i=0;i<sss;i++)
{if (inprimgroup(0,magroup,@primnum))
{setprimgroup(0, “ss”, @primnum, 0);}
};

it work well,and make not in group prim to a group named ss
but if you add a line:
string magroup = detailintrinsic(0, “primitivegroups”);
int sss = len(magroup);
setprimgroup(0, “ss”, @primnum, 1);

for(int i=0;i<sss;i++)
{if (inprimgroup(0,magroup,@primnum))
{setprimgroup(0, “ss”, @primnum, 0);}
};
@group_ss=0;

show the group ss in spreadsheet,it not bo zero

but if you add a prim attribuewrangle
cut @group_ss=0; to this

now show the group ss in spreadsheet,it be zero,correct

so i think have a bug between setprimgroup and @group_name
User Avatar
Member
11 posts
Joined:
Offline
oh,not “string magroup”
string magroup “array”

i can't type array symbol
Edited by darkdark132 - Feb. 6, 2020 18:21:05
User Avatar
Member
9380 posts
Joined: July 2007
Offline
darkdark132
thanks, !?* can be use in any group like SOP?
should work in any place that accepts group patterns

darkdark132
so i think have a bug between setprimgroup and @group_name
it's not a bug, but how VEX executes functions that are able to write to noncurrent element like setprimgroup() or setpointattrib(), …
they are queueued at the end and executed as a single threaded process as multiple ones can write to the ame element, that's why they win over your s@group_ss = 0 that is seemingly supposed to execute afterwards
while it's not thechnically a bug it's definitely not intuitive and requires some acceptance of how it works

darkdark132
i can't type array symbol
use code block, not only you can use special characters in there it's also much cleaner and safer way to share code as it's copy/paste friendly
like this:
string magroup[] = detailintrinsic(0, primitivegroups);
Edited by tamte - Feb. 6, 2020 22:17:34
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links