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?
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
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.
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