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 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 | In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
absolute (a) | bool | ||
|
|||
boundingBox (bb) | bool | ||
|
|||
boundingBoxInvisible (bbi) | bool | ||
Returns the bounding box of an object. This includes the bounding boxes of all invisible children which are not included using the boundingBox flag. The values returned are in following order: xmin ymin zmin xmax ymax zmax. |
|||
centerPivots (cp) | bool | ||
|
|||
deletePriorHistory (dph) | bool | ||
euler (eu) | bool | ||
|
|||
matrix (m) | float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float | ||
|
|||
objectSpace (os) | bool | ||
|
|||
pivots (piv) | float, float, float | ||
|
|||
preserve (p) | bool | ||
preserve overall transformation. used to prevent object from jumpingwhen changing pivots or rotation order. the default value is true. (used with -sp, -rp, -roo, -cp, -ra) |
|||
preserveUV (puv) | bool | ||
reflection (rfl) | bool | ||
reflectionAboutBBox (rab) | bool | ||
reflectionAboutOrigin (rao) | bool | ||
reflectionAboutX (rax) | bool | ||
reflectionAboutY (ray) | bool | ||
reflectionAboutZ (raz) | bool | ||
reflectionTolerance (rft) | float | ||
relative (r) | bool | ||
|
|||
rotateAxis (ra) | float, float, float | ||
|
|||
rotateOrder (roo) | unicode | ||
rotation order (when used with the -p flag the overall rotation is preserved by modifying the local rotation to be quivalent to the old one) Valid values for this flag are xyz | yzx | zxy | xzy | yxz | zyx |
|||
rotatePivot (rp) | float, float, float | ||
|
|||
rotateTranslation (rt) | float, float, float | ||
|
|||
rotation (ro) | float, float, float | ||
|
|||
scale (s) | float, float, float | ||
|
|||
scalePivot (sp) | float, float, float | ||
|
|||
scaleTranslation (st) | float, float, float | ||
|
|||
shear (sh) | float, float, float | ||
|
|||
translation (t) | float, float, float | ||
|
|||
worldSpace (ws) | bool | ||
|
|||
worldSpaceDistance (wd) | bool | ||
Values for -sp, -rp, -st, -rt, -t, -piv flags are treated as world space distances to move along the local axis. (where the local axis depends on whether the command is operating in local-space or object-space. This flag has no effect for world space. |
|||
zeroTransformPivots (ztp) | bool | ||
reset pivot points and pivot translations without changing the overall matrix by applying these values into the translation channel. Flag can have multiple arguments, passed either as a tuple or a list. |
Derived from mel command maya.cmds.xform
Example:
import pymel.core as pm
# create object to manipulate
pm.sphere( n='sphere1' )
# Result: [nt.Transform(u'sphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
# set rotation of sphere
pm.xform( r=True, ro=(0, 90, 0) )
# change the rotate order but preserve the overall transformation
pm.xform( p=True, roo='yzx' )