pymel.core.rendering.viewLookAt

viewLookAt(*args, **kwargs)

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.

Flags:

Long Name / Short Name Argument Types Properties
position / pos float, float, float ../../../_images/create.gif
  Position in world space to make the camera look at. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.viewLookAt

Example:

import pymel.core as pm

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

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