Skip to main content

Looping

Loop moving points on curve using CurveU:
int loop_frames = chi("loop_frame");
float fps = 29.97;
float loop_time = loop_frames / fps;


float t = @Time / loop_time;
t -= floor(t);

float ping = abs(2 * t - 1);
float speed_mult = chf("speed_mult");
ping *= speed_mult;

float exponent = chf("ease_exponent");
float slow_ping = pow(ping, exponent);

float u = f@curveu + slow_ping;
u -= floor(u);

int prim = i@class;
vector pos = primuv(1, "P", prim, set(u, 0, 0));
@P = pos;

Add a resample node with curveu, also to control amount of points

Loop points in Y:
int loop_frames = chi("loop_frames");
float fps = 29.97;
float loop_time = loop_frames / fps;


float t = @Time / loop_time;
t -= floor(t);


float offset = frac(t + rand(@ptnum)); // unique phase per point


float min_y = chf("min_y");
float max_y = chf("max_y");
float range = max_y - min_y;


@P.y = min_y + offset * range;