Go to: Synopsis. Notes. Return value. Related. Flags. Python examples.
xform(
[objects...]
, [absolute=boolean], [boundingBox=boolean], [boundingBoxInvisible=boolean], [centerPivots=boolean], [centerPivotsOnComponents=boolean], [deletePriorHistory=boolean], [euler=boolean], [matrix=[float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float]], [objectSpace=boolean], [pivots=[linear, linear, linear]], [preserve=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAboutBBox=boolean], [reflectionAboutOrigin=boolean], [reflectionAboutX=boolean], [reflectionAboutY=boolean], [reflectionAboutZ=boolean], [reflectionTolerance=float], [relative=boolean], [rotateAxis=[angle, angle, angle]], [rotateOrder=string], [rotatePivot=[linear, linear, linear]], [rotateTranslation=[linear, linear, linear]], [rotation=[angle, angle, angle]], [scale=[float, float, float]], [scalePivot=[linear, linear, linear]], [scaleTranslation=[linear, linear, linear]], [shear=[float, float, float]], [translation=[linear, linear, linear]], [worldSpace=boolean], [worldSpaceDistance=boolean], [zeroTransformPivots=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
xform is undoable, queryable, and NOT editable.
This command can be used query/set any element in a transformation node. It can also be used to query some values that cannot be set directly such as the transformation matrix or the bounding box. It can also set both pivot points to convenient values.
All values are specified in transformation coordinates. (attribute-space)
In addition, the attributes are applied/returned in the order in which they appear in the flags section. (which corresponds to the order they appear in the transformation matrix as given below)
See also: move, rotate, scale
-1 -1 [M] = [sp]x[s]x[sh]x[sp]x[st]x[rp]x[ar]x[ro]x[rp]x[rt]x[t]where:
[sp] = | 1 0 0 0 | = scale pivot matrix | 0 1 0 0 | | 0 0 1 0 | | -spx -spy -spz 1 |
[s] = | sx 0 0 0 | = scale matrix | 0 sy 0 0 | | 0 0 sz 0 | | 0 0 0 1 |
[sh] = | 1 0 0 0 | = shear matrix | xy 1 0 0 | | xz yz 1 0 | | 0 0 0 1 |
-1 [sp] = | 1 0 0 0 | = scale pivot inverse matrix | 0 1 0 0 | | 0 0 1 0 | | spx spy spz 1 |
[st] = | 1 0 0 0 | = scale translate matrix | 0 1 0 0 | | 0 0 1 0 | | stx sty stz 1 |
[rp] = | 1 0 0 0 | = rotate pivot matrix | 0 1 0 0 | | 0 0 1 0 | | -rpx -rpy -rpz 1 |
[ar] = | * * * 0 | = axis rotation matrix | * * * 0 | (composite rotation, | * * * 0 | see [rx], [ry], [rz] | 0 0 0 1 | below for details)
[rx] = | 1 0 0 0 | = rotate X matrix | 0 cos(x) sin(x) 0 | | 0 -sin(x) cos(x) 0 | | 0 0 0 1 |
[ry] = | cos(y) 0 -sin(y) 0 | = rotate Y matrix | 0 1 0 0 | | sin(y) 0 cos(y) 0 | | 0 0 0 1 |
[rz] = | cos(z) sin(z) 0 0 | = rotate Z matrix | -sin(z) cos(z) 0 0 | | 0 0 1 0 | | 0 0 0 1 |
-1 [rp] = | 1 0 0 0 | = rotate pivot matrix | 0 1 0 0 | | 0 0 1 0 | | rpx rpy rpz 1 |
[rt] = | 1 0 0 0 | = rotate translate matrix | 0 1 0 0 | | 0 0 1 0 | | rtx rty rtz 1 |
[t] = | 1 0 0 0 | = translation matrix | 0 1 0 0 | | 0 0 1 0 | | tx ty tz 1 |
None
In query mode, return type is based on queried flag.
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
absolute(a)
|
boolean
|
![]() |
||
|
||||
boundingBox(bb)
|
boolean
|
![]() |
||
|
||||
boundingBoxInvisible(bbi)
|
boolean
|
![]() |
||
|
||||
centerPivots(cp)
|
boolean
|
![]() |
||
|
||||
centerPivotsOnComponents(cpc)
|
boolean
|
![]() |
||
|
||||
deletePriorHistory(dph)
|
boolean
|
![]() |
||
|
||||
euler(eu)
|
boolean
|
![]() |
||
|
||||
matrix(m)
|
[float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float]
|
![]() ![]() |
||
|
||||
objectSpace(os)
|
boolean
|
![]() ![]() |
||
|
||||
pivots(piv)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
preserve(p)
|
boolean
|
![]() |
||
|
||||
preserveUV(puv)
|
boolean
|
![]() |
||
|
||||
reflection(rfl)
|
boolean
|
![]() |
||
|
||||
reflectionAboutBBox(rab)
|
boolean
|
![]() |
||
|
||||
reflectionAboutOrigin(rao)
|
boolean
|
![]() |
||
|
||||
reflectionAboutX(rax)
|
boolean
|
![]() |
||
|
||||
reflectionAboutY(ray)
|
boolean
|
![]() |
||
|
||||
reflectionAboutZ(raz)
|
boolean
|
![]() |
||
|
||||
reflectionTolerance(rft)
|
float
|
![]() |
||
|
||||
relative(r)
|
boolean
|
![]() |
||
|
||||
rotateAxis(ra)
|
[angle, angle, angle]
|
![]() ![]() |
||
|
||||
rotateOrder(roo)
|
string
|
![]() ![]() |
||
|
||||
rotatePivot(rp)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
rotateTranslation(rt)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
rotation(ro)
|
[angle, angle, angle]
|
![]() ![]() |
||
|
||||
scale(s)
|
[float, float, float]
|
![]() ![]() |
||
|
||||
scalePivot(sp)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
scaleTranslation(st)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
shear(sh)
|
[float, float, float]
|
![]() ![]() |
||
|
||||
translation(t)
|
[linear, linear, linear]
|
![]() ![]() |
||
|
||||
worldSpace(ws)
|
boolean
|
![]() ![]() |
||
|
||||
worldSpaceDistance(wd)
|
boolean
|
![]() ![]() |
||
|
||||
zeroTransformPivots(ztp)
|
boolean
|
![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds # create object to manipulate cmds.sphere( n='sphere1' ) # set rotation of sphere cmds.xform( r=True, ro=(0, 90, 0) ) # change the rotate order but preserve the overall transformation cmds.xform( p=True, roo='yzx' )