Go to: Synopsis. Return value. Keywords. Flags. Python examples.
matrixUtil([inverse=boolean], [quaternion=[float, float, float, float]], [relative=boolean], [rotation=[float, float, float]], [scale=[float, float, float]], [shear=[float, float, float]], [translation=[float, float, float]], [transpose=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
matrixUtil is undoable, queryable, and editable.
Command to deal with matrix, composition and decomposition
In query mode, return type is based on queried flag.
matrix, decomposeMatrix, decomposeMatrix
inverse, quaternion, relative, rotation, scale, shear, translation, transpose
Long name (short name) |
Argument types |
Properties |
inverse(iv)
|
boolean
|
|
|
Compose or query will return the inversed matrix.
|
|
quaternion(qt)
|
[float, float, float, float]
|
|
|
Compose, edit or query a matrix using specified quaternion values as rotation components.
|
|
relative(rt)
|
boolean
|
|
|
Add translation, rotation, scale or shear, instead of seting it as absolute.
|
|
rotation(r)
|
[float, float, float]
|
|
|
Compose, edit or query a matrix using specified values as rotation components.
|
|
scale(s)
|
[float, float, float]
|
|
|
Compose, edit or query a matrix using specified values as scale components.
|
|
shear(sh)
|
[float, float, float]
|
|
|
Compose, edit or query a matrix using specified values as shear components.
|
|
translation(t)
|
[float, float, float]
|
|
|
Compose a matrix using specified values as translation components.
|
|
transpose(tp)
|
boolean
|
|
|
Compose or query will return the transposed matrix.
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
#compose a matrix from translation, rotation, scale and shear
cmds.matrixUtil(t=[10, 20, 30], r=[90, 0, 90], s=[2, 3, 4], sh=[1, 0, 0])
#query translation
cmds.matrixUtil([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], q=True, t=True)
#query rotation
cmds.matrixUtil([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], q=True, r=True)
#query scale
cmds.matrixUtil([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], q=True, s=True)
#edit translation
cmds.matrixUtil([2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1], e=True, t=[3,4,5])