← Back to modelling
How to Move Points by Exact Color in Houdini Using VEX
30 Aug 26 (2mo ago)
Matching color (@Cd) with a strict equality check like @Cd == target_color will almost always fail in Houdini due to floating-point rounding errors.
The clean fix is using distance() to check if the color is within a tiny tolerance of your target value.
Set an Attribute Wrangle to run over Points and drop in this snippet:
// Target RGB values to isolate
vector target_color = set(0.693872, 0.658375, 0.508881);
// Threshold check bypasses float precision issues
if (distance(@Cd, target_color) < 0.0001) {
@P.y += 0.1;
}
The 0.0001 threshold catches the points reliably without false positives or silent misses.