pymel.core.rendering.viewFit

viewFit(*args, **kwargs)

The viewFit command positions the specified camera so its point-of-view contains all selected objects other than itself. If no objects are selected, everything is fit to the view (excepting cameras, lights, and sketching plannes). The fit- factor, if specified, determines how much of the view should be filled. If a camera is not specified, the camera in the active view will be used. After the camera is moved, its center of interest is set to the center of the bounding box of the objects.

Flags:
Long name (short name) Argument Types Properties
allObjects (all) bool ../../../_images/create.gif
 
Specifies that all objects are to be fit regardless of the active list.
animate (an) bool ../../../_images/create.gif
 

Specifies that the transition between camera positions should be animated.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

fitFactor (f) float ../../../_images/create.gif
 
Specifies how much of the view should be filled with the “fitted” items.
namespace (ns) unicode ../../../_images/create.gif
 
Specifies a namespace that should be excluded. All objects in the specified namespace will be excluded from the fit process.
panel (p) unicode  
   

Derived from mel command maya.cmds.viewFit

Example:

import pymel.core as pm

# Position the active camera to view the active objects
pm.viewFit()

# Position cameraShape-1 to view all objects
pm.viewFit( 'cameraShape1', all=True )

# Fill 50 percent of the active view with active objects
pm.viewFit( f=0.5 )

pm.viewFit( all=True )

Previous topic

pymel.core.rendering.viewClipPlane

Next topic

pymel.core.rendering.viewHeadOn

Core

Core Modules

Other Modules

This Page