Industricks

A compilation of usefull things I learned while working in the industry.

VEX

Unstep particles

if (rand(@id+6725)>0.5)
{@P = @P + @v*rand(@id)*ch("scale");}
else
{@P = @P - @v*rand(@id)*ch("scale");}

Find camera position/normal

string camera = chs("camera_path");
@P = ptransform(camera, "space:current", {0,0,0});
@N = ntransform(camera, "space:current", {0,0,-1});

Use the copy number of your node as ID

string path = opfullpath(".");
string dir = "";
string name = "";
splitpath(path,dir,name);
i@id = atoi(re_replace("pointwrangle","",name));

Convert vector in quaternion

@orient = dihedral(set(0,1,0),@v);

Convert a quaternion to vector

v@rot = degrees(quaterniontoeuler(p@orient,XFORM_XYZ));

PARAMETERS

Use a parameter of the previous node in a parameter

`chs("../"+opinput(".",0)+"/group")` // change "group" to desired parameter