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

Synopsis

upAxis([axis=string], [rotateView=boolean])

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

upAxis is undoable, queryable, and NOT editable.

The upAxis command changes the world up direction. Current implementation provides only two choices of axis (the Y-axis or the Z-axis) as the world up direction.

By default, the ground plane in Maya is on the XY plane. Hence, the default up-direction is the direction of the positive Z-axis.

The -ax flag is mandatory. In conjunction with the -ax flag, when the -rv flag is specified, the camera of currently active view is revolved about the X-axis such that the position of the groundplane in the view will remain the same as before the the up direction is changed.

The screen update is applied to all cameras of all views.

Return value

None

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

Flags

axis, rotateView
Long name (short name) Argument types Properties
axis(ax) string query
This flag specifies the axis as the world up direction. The valid axis are either "y" or "z".
When queried, it returns a string.
rotateView(rv) boolean create
This flag specifies to rotate the view as well.

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

# 1. to make the Y-axis of the world to be the up axis:
cmds.upAxis( ax='y' )

# 2. to make the Z-axis of the world to be the up axis,
# and rotate the view:
cmds.upAxis( ax='z', rv=True )

# 3. to query which axis is the current up axis
# (returns a string: a "y" or a "z"):
cmds.upAxis( q=True, axis=True )