Filter points by color

   4427   3   0
User Avatar
Member
19 posts
Joined: May 2016
Offline
I would like to create a SOP that filters points by their color. Can anyone give me a hint as to how I can achieve this with VEX?
User Avatar
Member
2539 posts
Joined: June 2008
Offline
You could use VEX to place certain points within a color range into their own group. Making groups in VEX is easy, you just prefix a name with the string constant ‘group_’.

Here is how you can place all points with with a dark red component into a dark_red group.
if (v@Cd.r <0.5) {
    group_dark_red = 1;
}
Follow up the point wrangle with another node that operates on the newly created group. For instance, Delete with the non-selected option enabled.
Edited by Enivob - Sept. 15, 2016 14:29:21
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
19 posts
Joined: May 2016
Offline
If I do this Houdini complains that it sees the group as an undefined variable. Any suggestions?
User Avatar
Member
2539 posts
Joined: June 2008
Offline
Oops, sorry about that. You do need the @ symbol in front of the group assignment.
if (v@Cd.r <0.5) {
@group_dark_red = 1;
}
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links