Skip to content

Get

vex
//where 1 is the input 2 of the attribute wrangles node
@P = point(1,"P",@ptnum);
vex
// detail mode
int numpnts = npoints(1);
printf("%g" , numpnts);
vex
// Get bounding box from second input
vector bbox = getbbox_max(1);
// set/create new vector with only one component
vector maxy = set(0, bbox.y, 0);
v@P = v@P + maxy;
vex
float some_val = getcomp(4@transform, 0, 1);
printf("%f", some_val);

getcomp-vexreference

vex
// point wrangle, points that share an edge
i[]@Neighbors = neighbours(0, @ptnum);
// or sorted
i[]@Neighbors = sort(neighbours(0, @ptnum));
vex
// run over points
int samples = chi("samples");
float radius = chf("radius");
int handle = pcopen(1, "P", @P, radius, samples);
vector rest = pcfilter(handle, 'rnml');
v@rnml = rest;

Interpolated Values from xyzdist and primuv

Section titled “Interpolated Values from xyzdist and primuv”
vex
// run over points
int posprim;
vector param_uv;
float maxdist = 10;
float dist = xyzdist(1,@P,posprim,param_uv,maxdist);
float curveu = primuv(1,"curveu",posprim,param_uv);
vector tangentu = primuv(1,"tangentu",posprim,param_uv);
f@curveu = curveu;
v@tangentu = tangentu;

source: The joy of xyzdist() and primuv()

Get all the groups as an array

vex
// run over points
string groups[] = detailintrinsic(0, "pointgroups");
s[]@tags = groups;

example found on: Groups to Attribute with VEX