VEX

You are here:
< Back

Attributes type

Float = f@attrib
Integer = i@attrib
String = s@attrib
Vector 2 = u@attrib
Vector 3 = v@attrib
Vector 4 = p@attrib
Matrix 2 = 2@attrib
Matrix 3 = 3@attrib
Matrix 4 = 4@attrib

v@my_vector = {0,0,0};
v@my_vector = set (dot (@N, @up) , 0, 0); // To add a dynamic value use the set function

Global Variables

// Available in all SOP wrangles
f@Frame //The current floating frame number, equivalent to the $FF Hscript variable
f@Time //The current time in seconds, equivalent to the $T Hscript variable
i@SimFrame //The integer simulation timestep number ($SF), only present in DOP contexts.
f@SimTime //The simulation time in seconds ($ST), only present in DOP contexts.
f@TimeInc //The timestep currently being used for simulation or playback.

// Available in Attribute Wrangle
v@P //The position of the current element.
i@ptnum //The point number attached to the currently processed element.
i@vtxnum //The linear number of the currently processed vertex.
i@primnum //The primitive number attached to the currently processed element.
i@elemnum //The index number of the currently processed element.
i@numpt //The total number of points in the geometry.
i@numvtx //The number of vertices in the primitive of the currently processed element.
i@numprim //The total number of primitives in the geometry.
i@numelem //The total number of elements being processed.

// Available in Volume Wrangle
v@P //The position of the current voxel.
f@density //The value of the density field at the current voxel location.
v@center //The center of the current volume.
v@dPdx, v@dPdy, v@dPdz //These vectors store the change in P that occurs in the x, y, and z voxel indices.
i@ix, i@iy, i@iz //Voxel indices. For dense volumes (non-VDB) these range from 0 to resolution-1.
i@resx, i@resy, i@resz //The resolution of the current volume.

Pointclouds

 int pts[] = pcfind(1,'P',@P,ch('rad'),ch('max_points'));
 int pt;
 vector pos;
 foreach (pt; pts) {
   pos = point(1,'P',pt);
   addpoint(1,pos);
 }

Point normal facing towards camera

string cam = chs("cam");
matrix camX = optransform(cam);
p@orient = quaternion(matrix3(camX));
onwheels Автор: