pymel.core.general.upAxis

upAxis(*args, **kwargs)

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. In query mode, return type is based on queried flag.

Flags:
Long name (short name) Argument Types Properties
axis (ax) unicode ../../../_images/query.gif
 
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) bool ../../../_images/create.gif
 
This flag specifies to rotate the view as well.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.upAxis

Example:

import pymel.core as pm

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

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

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

Previous topic

pymel.core.general.uniqueObjExists

Next topic

pymel.core.general.validComponentIndexType

Core

Core Modules

Other Modules

This Page