:E
https://www.sidefx.com/docs/houdini/vex/functions/frac.html
:J
https://www.sidefx.com/ja/docs/houdini/vex/functions/frac.html
◆PackedAlembic
--Transform off (= jump to origin)
setprimintrinsic(0, "abcusetransform", @primnum, 0, "set");
--back to default pos
-Transform position on point
@P = point(1, "P", @primnum);
-Transform scale & rot on prim
matrix xform = primintrinsic(1, "packedfulltransform", @primnum);
matrix scale = ident() * 100;
matrix3 rot = matrix3(xform * scale);
setprimintrinsic(0, "transform", @primnum, rot, "set");
if((@Frame > 50) && (@id % 5 == 0)) { dead = 1; }
int|string uniqueval(<geometry>geometry, string attribclass, string attribute_name, int which)
i.g.)
int count = nuniqueval(0, "point", "foo"); for (int i = 0; i < count; i++) { string val = uniqueval(0, "point", "foo", i); // ...do something with the value... }
int nuniqueval(<geometry>geometry, string attribclass, string attribute_name)
i.g.)
int test = nuniqueval(0, "point", "foo") == npoints(0)
string dir, name;
splitpath(opfullpath("."), dir, name);
return opdigits(name);
e.g.2)opfullpath(".")
- The full path of the current node being evaluatedopfullpath("..")
- The full path of the current node’s parent
vector pivotOffset= chv("PivotOffset");
vector pivotCentroid = primintrinsic(0, "pivot", @ptnum);
vector newPivot = pivotCentroid + pivotOffset;
setprimintrinsic(0, "pivot", @ptnum, newPivot);
@P += pivotOffset;
VEX type | Syntax |
---|---|
float |
f@name |
vector2 (2 floats) |
u@name |
vector (3 floats) |
v@name |
vector4 (4 floats) |
p@name |
int |
i@name |
matrix2 (2×2 floats) |
2@name |
matrix3 (3×3 floats) |
3@name |
matrix (4×4 floats) |
4@name |
string |
s@name |
VEX type | Attribute names |
---|---|
vector (3 floats) |
@P,
@accel,
@Cd,
@N,
@scale,
@force,
@rest,
@torque,
@up,
@uv,
@v@center , @dPdx , @dPdy , @dPdz (see Volume Wrangle). |
vector4 (4 floats) |
@backtrack, @orient, @rot |
int |
@id,
@nextid,
@pstate@elemnum , @ptnum , @primnum , vtxnum , @numelem , @numpt , @numprim , numvtx (see indexing variables below).@group_* (see accessing group membership below).@ix , @iy , @iz , @resx , @resy , @resz (see Volume Wrangle). |
string |
@name, @instance |
float angle = @Time; vector axis = rand(@ptnum); matrix3 m = ident(); rotate(m, angle, axis); @orient = quaternion(m);
float angle = @Time; vector axis = rand(@ptnum); @orient = quaternion(angle, axis);
float angle = chf("angle"); vector4 rot = quaternion(radian(angle), {0, 1, 0}); @N = qrotate(rot, @N);
-------calc centroid
vector min, max;
getbbox(min, max);
vector center = (min+max)/2;
Thx for reference!!
https://forums.odforce.net/topic/21514-centroid-in-pointwrangle/