Go to: Synopsis. Return value. Related. Flags. Python examples.
cameraView(
[object]
, [addBookmark=boolean], [bookmarkType=int], [camera=name], [name=string], [removeBookmark=boolean], [setCamera=boolean], [setView=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
cameraView is undoable, NOT queryable, and editable.
This command creates a preset view for a camera which is then
independent of the camera. The view stores a camera's eye point,
center of interest point, up vector, tumble pivot, horizontal
aperture, vertical aperature, focal length, orthographic width,
and whether the camera is orthographic or perspective by default.
Or you can only store 2D pan/zoom attributes by setting the
bookmarkType to 1. These settings can be applied to any other
camera through the set camera flag.
This command can be used for creation or edit of camera view
objects. This command can only be executed with one of the add
bookmark, or remove bookmark and one of set camera, or the set
view flags set.
string | (name of the camera view) |
camera, dolly, listCameras, lookThru, orbit, roll, track, tumble, viewCamera, viewClipPlane, viewFit, viewHeadOn, viewLookAt, viewPlace, viewSet
addBookmark, bookmarkType, camera, name, removeBookmark, setCamera, setView
Long name (short name) |
Argument types |
Properties |
|
addBookmark(ab)
|
boolean
|
|
|
Associate this view with the camera specified or the camera in
the active model panel. This flag can be used for creation or
edit.
|
|
bookmarkType(typ)
|
int
|
|
|
Specify the bookmark type, which can be: 0. 3D bookmark; 1. 2D
Pan/Zoom bookmark.
|
|
camera(c)
|
name
|
|
|
Specify the camera to use. This flag should be used in
conjunction with the add bookmark, remove bookmark, set
camera, or set view flags. If this flag is not specified the
camera in the active model panel will be used.
|
|
name(n)
|
string
|
|
|
Set the name of the view. This flag can only be used for
creation.
|
|
removeBookmark(rb)
|
boolean
|
|
|
Remove the association of this view with the camera specified
or the camera in the active model panel. This can only be used
with edit.
|
|
setCamera(sc)
|
boolean
|
|
|
Set this view into a camera specified by the camera flag or the
camera in the active model panel. This flag can only be used
with edit.
|
|
setView(sv)
|
boolean
|
|
|
Set the camera view to match a camera specified or the active
model panel. This flag can only be used with edit.
|
|
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
# Save the current position of the persp camera.
homeName = cmds.cameraView(camera='persp')
# Add this view to the persp bookmark menu.
cmds.cameraView( homeName, e=True, camera='persp', ab=True )
# Change the persp camera position.
cmds.dolly( 'persp', distance=-30 )
# Create another bookmark for the zoomed position.
cmds.cameraView( camera='persp', name='zoom', ab=True )
# Restore original camera position.
cmds.cameraView( homeName, e=True, camera='persp', sc=True )
# Save the current 2D pan/zoom attributes of the persp camera
panZoomBookmark = cmds.cameraView( camera='persp', ab=True, typ=1 )
# Enable 2D pan/zoom
cmds.setAttr( 'perspShape.panZoomEnabled', True )
# Pan right
cmds.panZoom( 'persp', r=0.6 )
# Restore original film position
cmds.cameraView( panZoomBookmark, e=True, camera='persp', sc=True )