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

Synopsis

cameraView [-addBookmark] [-bookmarkType int] [-camera name] [-name string] [-removeBookmark] [-setCamera] [-setView] [object]

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.

Return value

string(name of the camera view)

Related

camera, dolly, listCameras, lookThru, orbit, roll, track, tumble, viewCamera, viewClipPlane, viewFit, viewHeadOn, viewLookAt, viewPlace, viewSet

Flags

addBookmark, bookmarkType, camera, name, removeBookmark, setCamera, setView
Long name (short name) Argument types Properties
-camera(-c) name edit
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.
-addBookmark(-ab) createedit
Associate this view with the camera specified or the camera in the active model panel. This flag can be used for creation or edit.
-name(-n) string create
Set the name of the view. This flag can only be used for creation.
-removeBookmark(-rb) edit
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) edit
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) edit
Set the camera view to match a camera specified or the active model panel. This flag can only be used with edit.
-bookmarkType(-typ) int create
Specify the bookmark type, which can be: 0. 3D bookmark; 1. 2D Pan/Zoom bookmark.

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 be used more than once in a command.

MEL examples

// Save the current position of the persp camera.
string $homeName = `cameraView -camera persp`;
// Add this view to the persp bookmark menu.
cameraView -e -camera persp -ab $homeName;
// Change the persp camera position.
dolly -distance -30 persp;
// Create another bookmark for the zoomed position.
cameraView -camera persp -name "zoom" -ab;
// Restore original camera position.
cameraView -e -camera persp -sc $homeName;
// Save the current 2D pan/zoom attributes of the persp camera
string $panZoomBookmark = `cameraView -camera persp -ab -typ 1`;
// Enable 2D pan/zoom
setAttr "perspShape.panZoomEnabled" true;
// Pan right
panZoom -r 0.6 perspShape;
// Restore original film position
cameraView -e -camera persp -sc $panZoomBookmark