pymel.core.rendering.dolly

dolly(*args, **kwargs)

The dolly command moves a camera along the viewing direction in the world space. The viewing-direction and up-direction of the camera are not altered. There are two modes of operation: Relative mode: for a perspective camera, the camera is moved along its viewing direction, and the distance of travel is computed with respect to the current position of the camera in the world space. In relative mode, when the camera is moved, its COI is moved along with it, and is kept at the same distance, in front of the camera, as before applying the dolly operation. For orthographic camera, the viewing width of the camera is changed by scaling its ortho width by the new value specified on the command line. Absolute mode: for a perspective camera, the camera is moved along its viewing direction, to the distance that is computed with respect to the current position of the world center of interest (COI) of the camera. In the absolute mode, when the camera is moved, the COI of the camera is not moved with the camera, but it is fixed at its current location in space. For orthographic camera, the viewing width of the camera is changed by replacing its ortho width with the new value specified on the command line. This command may be applied to more than one cameras; objects that are not cameras are ignored. When no camera name supplied on the command line, this command is applied to all currently active cameras. The dolly command can be applied to either a perspective or an orthographic camera.

Flags:

Long Name / Short Name Argument Types Properties
absolute / abs bool ../../../_images/create.gif
  This flag modifies the behavior of the distance and orthoScale flags. When used in conjunction with the distance flag, the distance argument specifies how far the camera’s eye point should be set from the camera’s center of interest. When used with the orthoScale flag, the orthoScale argument specifies the camera’s new ortho width.
distance / d float ../../../_images/create.gif
  Unit distance to dolly a perspective camera.
dollyTowardsCenter / dtc bool ../../../_images/create.gif
  This flag controls whether the dolly is performed towards the center of the view (if true), or towards the point where the user clicks (if false). By default, dollyTowardsCenter is on.
orthoScale / os float ../../../_images/create.gif
  Scale to change the ortho width of an orthographic camera.
relative / rel bool ../../../_images/create.gif
  This flag modifies the behavior of the distance and orthoScale flags. When used in conjunction with the distance flag, the camera eye and center of interest are both moved by the amount specified by the distance flag’s argument. When used with the orthoScale flag, the orthoScale argument is used multiply the camera’s ortho width.By default the relative flag is always on. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.dolly

Example:

import pymel.core as pm

pm.camera()
# Result: [nt.Transform(u'camera1'), nt.Camera(u'cameraShape1')] #

# Moves the persp camera forward through its center of interest
pm.dolly( 'persp', abs=True, d=-3 )

# Move the persp camera and its center of interest.
pm.dolly( 'persp', d=-3 )

# Changes the ortho-width of the top camera to 7.5
pm.dolly( 'top', abs=True, os=7.5 )

# Scale the ortho-width of the top camera by a quarter from its current value.
pm.dolly( 'top', os=0.25 )