Skip to content

Curves

Create Curveu attribute for each curve using vex

Sample attribute

Point.wrangle
// Get curveu for each prim in poinwrangle
float curveu = vertexcurveparam(0, @vtxnum);
// Bind attribute
f@width = chramp("width_ramp", curveu) * chf("width_mult");

How to create carve with vex in Houidni

Very often in Houdini, you need to create flexible curve-growing animations. One of the most robust ways to do this is by using VEX. By combining it with various mask multiplications and noises, you can achieve very interesting effects.

Sample attribute

Primitive.wrangle
int ppts[] = primpoints(0, @primnum);
foreach(int i; int pt; ppts){
float t = float(i)/(len(ppts)-1);
float u2 = fit01(t, 0, chf("max_u"));
vector p2 = primuv(0, "P", @primnum, set(u2, 0,0));
vector tan = primuv(0, "tan", @primnum, set(u2, 0,0));
vector N = primuv(0, "N", @primnum, set(u2, 0,0));
setpointattrib(geoself(), "P", pt, p2, "set");
setpointattrib(geoself(), "tan", pt, tan, "set");
setpointattrib(geoself(), "N", pt, N, "set");
}