invert a group selection

   37967   5   2
User Avatar
Member
511 posts
Joined:
Offline
Hi there, new convert here

I have created a polygon group so that I can attach a shader to it… all good, but I want to create a second group which is the inverse of the first. Is there a quick way to invert a group selection? … I imagine this can be done via an expression if I copy and past the pattern into the experssion filter?

btw re shader assignment, if there are two groups that overlap which shader gets priority in the ovelapped area?

and… is it possible to grow a polugon selection?

thanks
Serg
User Avatar
スタッフ
3464 posts
Joined: 7月 2005
Offline
to invert the group
go to the Combine Tab and in the first field put the name of the new, inverse group then hit the little blank square so that the “!” shows up, then in the next field put the name of the original group
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
511 posts
Joined:
Offline
Thanks that did the trick

does the ! mean invert generaly?
User Avatar
Member
509 posts
Joined: 7月 2005
Offline
technically it means.. "not' … so !red… means NOT red.

cheers
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
12 posts
Joined: 9月 2014
Offline
Hi, another newbie here,

I have something similar but I'm trying to create three groups of poly's (surfaces) from the given mesh. I have created a note for the first two, but the third group is made of very small poly's which would be easier to select via the inverse of the first two groups combined. (if that makes sense).

I'm using houdini 14.0.291.
Any help is appreciated.
Thanks.

I just got it! In the combine tab for third group… group3 = ! group1 AND ! group2.

Leaving this for someone.
Thanks anyway.
User Avatar
Member
4 posts
Joined: 10月 2017
Offline
There are a few ways to invert a group on houdini:

The most common is calling the group with an excalamation before:
Ex: if your group is called test, when you're calling it on a node (HScript)just use “!test” which basically means “all but test”.

Another way, especially if you are going to mess around a lot with a group is reverse it from de beggining, and you could do it with vex, a combine node etc.
I usually use a wrangle running over the same class of geometry than your group, you could write:

(All the options are resulting the same)
1.— @group_test = abs(1-@group_test);
2.— @group_test = fit01(@group_test,1,0);(Inverting from 0-1 to 1-0);
3.— @group_test =!@group_sides;
etc.
I'm avoiding comparisons statements“If, else, …” because usually, they are slower to compute than the bast majority of aritmetically operations (the 3rd option is one, but is very short heh).

Optionally if it fits better in your nodegraph, or you are “vex-lazy”, you could try with a combine node, setting your group equal to the inverted one;
Ex. Group: “test” Equals: !test

A hiplc is worth a thousand words:

Attachments:
grp_invert.hipnc (140.3 KB)

  • Quick Links