VEX – Build-in Attributes
// // // //Build-in Attributes //Point int pointNumber = @ptnum; int numberOfPoints = @numpt; vector pos0 = point(0, "P", @ptnum); //get attribute setpointattrib(0, "P", @ptnum, set(0,0,0), "set"); // set attribute
Technical Art & Games
// // // //Build-in Attributes //Point int pointNumber = @ptnum; int numberOfPoints = @numpt; vector pos0 = point(0, "P", @ptnum); //get attribute setpointattrib(0, "P", @ptnum, set(0,0,0), "set"); // set attribute
// // // //Rotate Points in XZ-Plane vector rotAxis = set(0,1,0); // Set rotation axis to Y (we’re working on ‘2D’ here) vector X = (@P-point(0, "P", @ptnum+1)) * {1,0,1};
//Find the 2 closest points for each point i@closestPoint = -1; i@secondClosestPoint = -1; float dist1 = 1000000; float dist2 = 1000000; for(int i = 0; i < @numpt; i++){
Switches the node visibility on/offf … Continue readingHouPython – Set Node Display Flag
# # # #Change the clipping planes in the viewport. Useful if you often change between extremely large objects and very small ones. import toolutils nearFar = (0.1, 2000000) viewport
//Count verticies for each prim and store in detail with dynamic attribute name for(int i = 0; i < @numprim; i++) { int newatt = adddetailattrib(0, "prim"+itoa(i)+"_verts", len(primvertices(0,i))); }
// // // //Delete all verticies (Run Over = ‘Detail’) int numPrims = @numprim; int numVerts = 0; for(int j = 0; j < numPrims; j++) { numVerts += len(primvertices(0,j));
// // // //Delete Points (Run Over = ‘Detail’) int pts = @numpt; for(int i = pts-1; i >= 0; i–) { removepoint(0,i); }
// // // //CREATE QUADS //create points (shared among prims) addpoint(0, {-150,0,0}); addpoint(0, {150,0,0}); addpoint(0, {-100,0,100}); addpoint(0, {100,0,100}); addpoint(0, {-150,0,200}); addpoint(0, {150,0,200}); int points[] = primpoints(0, 0); //create prims without
// // // //Get attribute from another point vector p = point(0, "P", @ptnum-1); // get pos from prev point