explodematrix expression function
Explodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.
Replaced by: hou.Matrix4
Usage
explodematrix(mat, trs, xyz, component)
The returned components can be stuffed directly into Houdini rotation, scale, and translate channels.
If you know the pivot point for the transformation, you may want to use the explodematrixp function instead.
mat is the matrix to transform. trs and xyz give the order of the expansion. In trs, a “t” represents translation, “r” rotation, and “s” scale. The xyz refers to the order of the rotations. The component is a string describing which channel to extract. It is “[trs][xyz]” (e.g. "tx" or "ry"), where the t, r, or s chooses the channel (translate, rotate, or scale), and the x, y, or z chooses the axis.
Examples
explodematrix(mlookat(vector("[1,0,0]"),vector("[0,1,0]")), "RST", "XYZ", "RZ")
explodematrix(identity(3)*2, "RST", "XYZ", "SZ")