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

Synopsis

rotate( x y z [object 1] [object 2] ... , [absolute=boolean], [centerPivot=boolean], [euler=boolean], [objectCenterPivot=boolean], [objectSpace=boolean], [pivot=[double, double, double]], [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], [worldSpace=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

rotate is undoable, queryable, and 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.

Return value

None

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

Related

move, scale, xform

Flags

absolute, centerPivot, euler, objectCenterPivot, objectSpace, pivot, reflection, reflectionAboutBBox, reflectionAboutOrigin, reflectionAboutX, reflectionAboutY, reflectionAboutZ, reflectionTolerance, relative, rotateX, rotateXY, rotateXYZ, rotateXZ, rotateY, rotateYZ, rotateZ, worldSpace
Long name (short name) argument types Properties
absolute(a) boolean create
Perform an absolute operation.
relative(r) boolean create
Perform a operation relative to the object's current position
reflection(rfl) boolean create
To move the corresponding symmetric components also.
reflectionAboutOrigin(rao) boolean create
Sets the position of the reflection axis at the origin
reflectionAboutBBox(rab) boolean create
Sets the position of the reflection axis at the geometry bounding box
reflectionAboutX(rax) boolean create
Specifies the X=0 as reflection plane
reflectionAboutY(ray) boolean create
Specifies the Y=0 as reflection plane
reflectionAboutZ(raz) boolean create
Specifies the Z=0 as reflection plane
reflectionTolerance(rft) float create
Specifies the tolerance to findout the corresponding reflected components
centerPivot(cp) boolean create
Let the pivot be the center of the bounding box of all objects
objectCenterPivot(ocp) boolean create
Let the pivot be the center of the bounding box of each object
pivot(p) [double, double, double] create
Define the pivot point for the transformation
objectSpace(os) boolean create
Perform rotation about object-space axis.
worldSpace(ws) boolean create
Perform rotation about global world-space axis.
euler(eu) boolean create
Modifer for -relative flag that specifies rotation values should be added to current XYZ rotation values.
rotateX(x) boolean create
Rotate in X direction
rotateY(y) boolean create
Rotate in Y direction
rotateZ(z) boolean create
Rotate in Z direction
rotateXY(xy) boolean create
Rotate in X and Y direction
rotateXZ(xz) boolean create
Rotate in X and Z direction
rotateYZ(yz) boolean create
Rotate in Y and Z direction
rotateXYZ(xyz) boolean create
Rotate in all directions (default)

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

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