Skip to content

cracktransform

vector  cracktransform(int trs, int xyz, int c, vector pivot, vector pivot_rotate, matrix xform)

vector  cracktransform(int trs, int xyz, int c, vector pivot, matrix xform)

Depending on the value of c, returns the translate (c=0), rotate (c=1 or c=4), scale (c=2) or shears (c=3) component of the transform (xform). The function uses the given transform and rotation orders (trs and xyz) , the given pivot point (pivot) and optional pivot rotation (pr) to calculate the return value.

Note Rotation angles (when c=1) are returned in degrees, whereas many other VEX functions use radians. You can use the radians VEX function to convert the vector of angles in degrees to a vector of angles in radians. For example: vector angles = radians(cracktransform(XFORM_TRS, XFORM_XYZ, 1, {0,0,0}, M));

Note Rotation angles (when c=4) are returned in radians.

trs

One of the transform order constants listed below, which can be imported from $HFS/houdini/vex/include/math.h.

Constant nameTransform Order
XFORM_SRTScale, Rotate, Translate
XFORM_STRScale, Translate, Rotate
XFORM_RSTRotate, Scale, Translate
XFORM_RTSRotate, Translate, Scale
XFORM_TSRTranslate, Scale, Rotate
XFORM_TRSTranslate, Rotate, Scale

xyz

One of the rotation order constants listed below, which can be imported from $HFS/houdini/vex/include/math.h.

Constant nameRotation Order
XFORM_XYZRotate order X, Y, Z
XFORM_XZYRotate order X, Z, Y
XFORM_YXZRotate order Y, X, Z
XFORM_YZXRotate order Y, Z, X
XFORM_ZXYRotate order Z, X, Y
XFORM_ZYXRotate order Z, Y, X

void  cracktransform(int trs, int xyz, vector pivot, vector pivot_rotate, matrix xform, vector &t, vector &r, vector &s, vector &shears)

Returns the translate, rotate, scale, and shear components of xform in t, r, s, and shears, respectively. If more than one component is needed, using this overload is more efficient than making multiple calls to the other function signature.

void  cracktransform(int trs, int xyz, vector pivot, matrix xform, vector &t, vector &r, vector &s)

Returns the translate, rotate, and scale of xform in t, r, s respectively. This overload doesn’t support pivot_rotate or shears. If more than one component is needed, using this overload is more efficient than making multiple calls to the other function signature.