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

Synopsis

viewLookAt( [camera] , [position=[linear, linear, linear]])

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

viewLookAt is undoable, NOT queryable, and NOT editable.

The viewLookAt command positions the specified camera so it is looking at the centroid of all selected objects. If no objects are specified the camera will look at the ground plane.

Return value

None

Related

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

Flags

position
Long name (short name) Argument types Properties
position(pos) [linear, linear, linear] create
Position in world space to make the camera look at.

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

# Create a new camera
cam = cmds.camera()
camera = cam[0]

cmds.viewLookAt( camera, pos=(0.0, 1.0, 0.0) )