This command positions the camera to one of the pre-defined positions. If the fit flag is set in conjunction with persp, top, side, or front; the view is “fit” based on the list of selected objects (if there are any) or on all the objects if nothing is selected. If a camera is not specified, the camera in the active view will be used. If no flag is specified, the camera is set to the home position. In query mode, return type is based on queried flag.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
animate (an) | bool | ||
back (b) | bool | ||
|
|||
bottom (bo) | bool | ||
|
|||
fit (fit) | bool | ||
fitFactor (ff) | float | ||
Specifies how much of the view should be filled with the “fitted” itemsFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
front (f) | bool | ||
|
|||
home (h) | bool | ||
Executes the camera’s home attribute command. Before the string is executed, all occurances of “%camera” will be replaced by the camera’s name. Use the camera command to set a camera’s home command. |
|||
keepRenderSettings (krs) | bool | ||
leftSide (ls) | bool | ||
|
|||
namespace (ns) | unicode | ||
nextView (nv) | bool | ||
|
|||
persp (p) | bool | ||
|
|||
previousView (pv) | bool | ||
|
|||
rightSide (rs) | bool | ||
|
|||
side (s) | bool | ||
|
|||
t (t) | bool | ||
top (top) | bool | ||
|
Derived from mel command maya.cmds.viewSet
Example:
import pymel.core as pm
import maya.cmds as cmds
# Create a new camera
cam = pm.camera();
camShape = cam[1];
# Set cameraShape1 to the persp position
pm.viewSet( camShape, p=True )
# Set the camera in the active view to the top position
pm.viewSet( t=True )