Houdini - Animating with UV
The network, at the most basic level needs only 2 things: a path, and a point.
The magic sauce and engine that drives the whole thing is Attribute Interpolate. It expects points from its first input, and paths/primitives from its second input.
The points from the first input must have:
-
i@sourceprim
– match this to a@primnum
from the second input. -
v@sourceprimuv
– where to place the point on thesourceprim
.
Note, a Scatter node can give us these attributes for free.
v@sourceprimuv
is a number 0 <> 1
. At 0
the point is at the start of the uv e.g. start of the curve. When it gets to 1.0
, it’s at the end of the curve.
To make the point “move”, we simply have to “animate” v@sourceprimuv
!
float trt = 10; // Total seconds
v@sourceprimuv = @Time/trt; // The absolute laziest way
v@sourceprimuv = @Time/trt % 1; // With modulo if we want to loop
v@sourceprimuv.x = v@sourceprimuv.x * @Time/trt * some_speed_factor; // Proper