Go to: Synopsis. Return value. Related. Flags. Python examples.
rotate(
float float float [objects]
, [absolute=boolean], [centerPivot=boolean], [componentSpace=boolean], [constrainAlongNormal=boolean], [deletePriorHistory=boolean], [euler=boolean], [forceOrderXYZ=boolean], [objectCenterPivot=boolean], [objectSpace=boolean], [orientAxes=[angle, angle, angle]], [pivot=[linear, linear, linear]], [preserveChildPosition=boolean], [preserveGeometryPosition=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAboutBBox=boolean], [reflectionAboutOrigin=boolean], [reflectionAboutX=boolean], [reflectionAboutY=boolean], [reflectionAboutZ=boolean], [reflectionTolerance=float], [relative=boolean], [rotateX=boolean], [rotateXY=boolean], [rotateXYZ=boolean], [rotateXZ=boolean], [rotateY=boolean], [rotateYZ=boolean], [rotateZ=boolean], [symNegative=boolean], [translate=boolean], [worldSpace=boolean], [xformConstraint=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
rotate is undoable, NOT queryable, and NOT editable.
The rotate command is used to change the rotation of
geometric objects. The rotation values are specified as
Euler angles (rx, ry, rz). The values are interpreted based
on the current working unit for Angular measurements. Most
often this is degrees.
The default behaviour, when no objects or flags are passed,
is to do a absolute rotate on each currently selected object
in the world space.
None
move, scale, xform, xformConstraint
absolute, centerPivot, componentSpace, constrainAlongNormal, deletePriorHistory, euler, forceOrderXYZ, objectCenterPivot, objectSpace, orientAxes, pivot, preserveChildPosition, preserveGeometryPosition, preserveUV, reflection, reflectionAboutBBox, reflectionAboutOrigin, reflectionAboutX, reflectionAboutY, reflectionAboutZ, reflectionTolerance, relative, rotateX, rotateXY, rotateXYZ, rotateXZ, rotateY, rotateYZ, rotateZ, symNegative, translate, worldSpace, xformConstraint
Long name (short name) |
Argument types |
Properties |
|
absolute(a)
|
boolean
|
|
|
Perform an absolute operation.
|
|
centerPivot(cp)
|
boolean
|
|
|
Let the pivot be the center of the bounding box of all objects
|
|
componentSpace(cs)
|
boolean
|
|
|
Rotate in local component space
|
|
constrainAlongNormal(xn)
|
boolean
|
|
|
When true, transform constraints are applied along the vertex normal first
and only use the closest point when no intersection is found along the normal.
|
|
deletePriorHistory(dph)
|
boolean
|
|
|
If true then delete the history prior to the current operation.
|
|
euler(eu)
|
boolean
|
|
|
Modifer for -relative flag that specifies rotation
values should be added to current XYZ rotation values.
|
|
forceOrderXYZ(fo)
|
boolean
|
|
|
When true, euler rotation value will be understood in XYZ rotation order not per transform node basis.
|
|
objectCenterPivot(ocp)
|
boolean
|
|
|
Let the pivot be the center of the bounding box of each object
|
|
objectSpace(os)
|
boolean
|
|
|
Perform rotation about object-space axis.
|
|
orientAxes(oa)
|
[angle, angle, angle]
|
|
|
Euler axis for orientation.
|
|
pivot(p)
|
[linear, linear, linear]
|
|
|
Define the pivot point for the transformation
|
|
preserveChildPosition(pcp)
|
boolean
|
|
|
When true, transforming an object will apply an opposite transform to its
child transform to keep them at the same world-space position.
Default is false.
|
|
preserveGeometryPosition(pgp)
|
boolean
|
|
|
When true, transforming an object will apply an opposite transform to its
geometry points to keep them at the same world-space position.
Default is false.
|
|
preserveUV(puv)
|
boolean
|
|
|
When true, UV values on rotated components are projected across the rotation
in 3d space. For small edits, this will freeze the world space texture mapping
on the object.
When false, the UV values will not change for a selected vertices.
Default is false.
|
|
reflection(rfl)
|
boolean
|
|
|
To move the corresponding symmetric components also.
|
|
reflectionAboutBBox(rab)
|
boolean
|
|
|
Sets the position of the reflection axis at the geometry bounding box
|
|
reflectionAboutOrigin(rao)
|
boolean
|
|
|
Sets the position of the reflection axis at the origin
|
|
reflectionAboutX(rax)
|
boolean
|
|
|
Specifies the X=0 as reflection plane
|
|
reflectionAboutY(ray)
|
boolean
|
|
|
Specifies the Y=0 as reflection plane
|
|
reflectionAboutZ(raz)
|
boolean
|
|
|
Specifies the Z=0 as reflection plane
|
|
reflectionTolerance(rft)
|
float
|
|
|
Specifies the tolerance to findout the corresponding reflected components
|
|
relative(r)
|
boolean
|
|
|
Perform a operation relative to the object's current position
|
|
rotateX(x)
|
boolean
|
|
|
rotateXY(xy)
|
boolean
|
|
|
Rotate in X and Y direction
|
|
rotateXYZ(xyz)
|
boolean
|
|
|
Rotate in all directions (default)
|
|
rotateXZ(xz)
|
boolean
|
|
|
Rotate in X and Z direction
|
|
rotateY(y)
|
boolean
|
|
|
rotateYZ(yz)
|
boolean
|
|
|
Rotate in Y and Z direction
|
|
rotateZ(z)
|
boolean
|
|
|
symNegative(smn)
|
boolean
|
|
|
When set the component transformation is flipped so it is relative to the
negative side of the symmetry plane. The default (no flag) is to transform
components relative to the positive side of the symmetry plane.
|
|
translate(t)
|
boolean
|
|
|
When true, the command will modify the node's translate attribute instead of its
rotateTranslate attribute, when rotating around a pivot other than the object's
own rotate pivot.
|
|
worldSpace(ws)
|
boolean
|
|
|
Perform rotation about global world-space axis.
|
|
xformConstraint(xc)
|
string
|
|
|
Apply a transform constraint to moving components.
- none - no constraint
- surface - constrain components to the surface
- edge - constrain components to surface edges
- live - constraint components to the live surface
|
|
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
# create a circle and grouped cone to rotate;
cmds.circle( n='circle1' )
cmds.cone( ax=(0, 1, 0), n='cone1' )
cmds.group( 'cone1', n='group1' )
# rotate the active objects 45 degrees about the world space X axis
# centered at each object's rotate pivot point.
cmds.select( 'cone1' )
cmds.rotate( '45deg', 0, 0, r=True )
# Set the rotation values for group1 to (90, 0, 0). This is
# equivalent to:
# cmds.setAttr('group1.rx',90)
# cmds.setAttr('group1.ry',0)
# cmds.setAttr('group1.rz',0)
cmds.rotate( '90deg', 0, 0, 'group1' )
# rotate the circle 180 degrees about its local space Y axis
# centered at the rotate pivot point 1 0 0.
cmds.rotate( 0, '180deg', 0, 'circle1', pivot=(1, 0, 0) )