Go to: Synopsis. Return value. Related. Flags. Python examples.
dolly(
[camera]
, [absolute=boolean], [distance=linear], [dollyTowardsCenter=boolean], [orthoScale=float], [relative=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
dolly is undoable, NOT queryable, and NOT editable.
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.
None
camera, cameraView, listCameras, lookThru, orbit, roll, track, tumble, viewCamera, viewClipPlane, viewFit, viewHeadOn, viewLookAt, viewPlace, viewSet
absolute, distance, dollyTowardsCenter, orthoScale, relative
Long name (short name) |
Argument types |
Properties |
|
absolute(abs)
|
boolean
|
|
|
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)
|
linear
|
|
|
Unit distance to dolly a perspective camera.
|
|
dollyTowardsCenter(dtc)
|
boolean
|
|
|
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
|
|
|
Scale to change the ortho width of an orthographic camera.
|
|
relative(rel)
|
boolean
|
|
|
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 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.
|
import maya.cmds as cmds
cmds.camera()
# Moves the persp camera forward through its center of interest
cmds.dolly( 'persp', abs=True, d=-3 )
# Move the persp camera and its center of interest.
cmds.dolly( 'persp', d=-3 )
# Changes the ortho-width of the top camera to 7.5
cmds.dolly( 'top', abs=True, os=7.5 )
# Scale the ortho-width of the top camera by a quarter from its current value.
cmds.dolly( 'top', os=0.25 )