Procedural attribute remap to 0-1 space

First promote the attribute’s minimum and maximum value to detail attributes. Name the attributes min and max. Then run this script in attribute wrangle node. This is an example for float point attributes, so it needs to be run over points. Remember to click the “create spare parameters“ button next to the snippet to create a string parameter box for the attribute name and then type in the attribute you want to fit.

float min = detail(0,"min");
float max = detail(0,"max");
string attrib_name = chs("attrib_name");
float attrib = point(0,attrib_name,@ptnum);

attrib = fit(attrib,min,max,0,1);

setpointattrib(0,attrib_name,@ptnum,attrib);
Previous
Previous

Angle Between Two Vectors (VEX)

Next
Next

Boolean Curves With Geometry in Houdini