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

Synopsis

viewHeadOn( [camera] )

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

viewHeadOn is undoable, NOT queryable, and NOT editable.

The viewHeadOn command positions the specified camera so it is looking "down" the normal of the live object, and fitted to the live object. If the live object is a surface, an arbitrary normal is chosen.

Return value

None

Related

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

Python examples

import maya.cmds as cmds

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

# Create a polygonal cone, rotate it, make it live
object = cmds.polyCone( ax=(0, 1, 0) )
cmds.rotate( 15, 30, 45 )
cmds.makeLive( object[0] )

cmds.viewHeadOn( camera )

cmds.makeLive( none=True )