Hi all, how would I select and group all of the 'blue' points/vertex colours on a mesh? all help appreciated!
Dave
How do I select points based on their colour?
2460 4 1- evilpikmin
- Member
- 13 posts
- Joined: May 2014
- Offline
- Enivob
- Member
- 2540 posts
- Joined: June 2008
- Offline
You could try this inside a point wrangle.
NOTE: This wont "select" them in the interface, but it will add them to a group you can perform operations upon.
i@group_ is a built-in mechanism for assigning points/prims to groups. The group generated is not named "group_all_blue". The group the code will create is called "all_blue".
The flaw in the above code is that points with other red and green content might be included. You can extend this with more code checking...
// Using 0.9 instead of 1.0 to allow for a little error in the color. if(v@Cd.b>0.9){i@group_all_blue = 1;}
i@group_ is a built-in mechanism for assigning points/prims to groups. The group generated is not named "group_all_blue". The group the code will create is called "all_blue".
The flaw in the above code is that points with other red and green content might be included. You can extend this with more code checking...
int no_red = 1; int no_green = 1; float threshold_low = 0.1; float threshold_high = 0.9; if (v@Cd.r<threshold_low){no_red = 0;} if (v@Cd.g<threshold_low){no_green = 0;} if (no_red+no_green == 0){ //Time to check for blue. if(v@Cd.b>0.9){i@group_all_blue = 1;} }
Edited by Enivob - March 5, 2022 15:01:33
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- mestela
- Member
- 1743 posts
- Joined: May 2006
- Offline
Strikes me that this shouldn't require vex. I thought maybe I could use the attribute adjust colour node as a basic keyer, isolate to a range of blues and export as a mask, but it doesn't quite fit the bill. Looked to see if there was something hiding in the 'mask by...' sops, but couldn't see one.
Worth an RFE? Or is there a method I'm missing? I think a 'mask by colour' sop or mode within mask by attribute/vector could be really handy.
Worth an RFE? Or is there a method I'm missing? I think a 'mask by colour' sop or mode within mask by attribute/vector could be really handy.
- evilpikmin
- Member
- 13 posts
- Joined: May 2014
- Offline
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Offline
-
- Quick Links