Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

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

Return value

stringCommand result

In query mode, return type is based on queried flag.

Keywords

matrix, decomposeMatrix, decomposeMatrix

Flags

inverse, quaternion, relative, rotation, scale, shear, translation, transpose
Long name (short name) Argument types Properties
inverse(iv) boolean createqueryedit
Compose or query will return the inversed matrix.
quaternion(qt) [float, float, float, float] createqueryedit
Compose, edit or query a matrix using specified quaternion values as rotation components.
relative(rt) boolean createqueryedit
Add translation, rotation, scale or shear, instead of seting it as absolute.
rotation(r) [float, float, float] createqueryedit
Compose, edit or query a matrix using specified values as rotation components.
scale(s) [float, float, float] createqueryedit
Compose, edit or query a matrix using specified values as scale components.
shear(sh) [float, float, float] createqueryedit
Compose, edit or query a matrix using specified values as shear components.
translation(t) [float, float, float] createqueryedit
Compose a matrix using specified values as translation components.
transpose(tp) boolean createqueryedit
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.

Python examples

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])