pymel.core.rendering.camera

camera(*args, **kwargs)

Create, edit, or query a camera with the specified properties. The resulting camera can be repositioned using the viewPlace command. Many of the camera settings only affect the resulting rendered image. E.g. the F/Stop, shutter speed, the film related options, etc. Scaling the camera icon does not change any camera properties.

Flags:
Long name (short name) Argument Types Properties
aspectRatio (ar) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The ratio of the film back width to the film back height.
cameraScale (cs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Scale the camera.
centerOfInterest (coi) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the linear distance from the camera’s eye point to the center of interest.
clippingPlanes (cp) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate manual clipping planes.
depthOfField (dof) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Determines whether a depth of field calculation is performed to give varying focus depending on the distance of the objects.
displayFieldChart (dfc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the video field chart when looking through the camera.
displayFilmGate (dfg) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the film gate icons when looking through the camera.
displayFilmOrigin (dfo) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate the display of the film origin guide when looking through the camera.
displayFilmPivot (dfp) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the film pivot guide when looking through the camera.
displayGateMask (dgm) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Display the gate mask, file or resolution, as a shaded area to the edge of the viewport.
displayResolution (dr) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the current rendering resolution (as defined in the render globals) when looking through the camera.
displaySafeAction (dsa) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the video Safe Action guide when looking through the camera.
displaySafeTitle (dst) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate display of the video Safe Title guide when looking through the camera.
fStop (fs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

A real lens normally contains a diaphragm or other stop which blocks some of the light that would otherwise pass through it. This stop is usually approximately round, and its diameter as seen from the front of the lens is called the lens diameter. The lens diameter is often described by its relation to the focal length of the lens. A lens whose diameter is one-eighth its local length is said to have an F-stop of 8. This is an optical property of the lens.

farClipPlane (fcp) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify the distance to the far clipping plane.
farFocusDistance (ffd) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Linear distance to the far focus plane.
filmFit (ff) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This describes how the digital image (in pixels) relates to the film back. Since the film back is defined in terms of real numbers with some arbitrary film aspect, and the digital image is defined in integer pixels with an equally arbitrary (and different) resolution, relating the two can get complicated. There are 4 choices: horizontalIn this case the digital image is made to fit the film back exactly in the horizontal direction. This then gives each pixel a horizontal size = (film back width) / (horizontal resolution). The pixel height is then = (pixel width) / (pixel aspect ratio). Now that the pixel has a size, resolution gives us a complete image. That image will match the film back exactly in width. It will almost never match in height, either being too tall or too short. By playing with the numbers you can get it pretty close though.verticalThis is the same idea as horizontal fit, only applied vertically. Thus the digital image will match the film back exactly in height, but miss in width.fillThis is a convenience item. The system calculates both horizontal and vertical fits and then applies the one that makes the digital image larger than the film back.overscanOverscanning the film gate in the camera view allows us to choreograph action outside of the frustum from within the camera view without having to resort to a dolly or zoom. This feature is also essential for animating image planes.

filmFitOffset (ffo) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Since we know from the above that the digital image may not match the film back exactly, we now have the question of how to position one relative to the other. Thus fit offset. Normally the centers are aligned. Fit offset lets you move the smaller image within the larger one. Specify the distance for film offset (inches).

filmRollOrder (fro) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies how the roll is applied with respect to the pivot value. Rotate-TranslateThe film back is first rotated then translated by the pivot point value .Translate-RotateThe film back is first translated then rotated by the film roll value.

filmRollValue (frv) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This specifies that amount of rotation around the film back. The roll value is specified in degrees. The rotation occurs around the specified pivot point. This value is used to compute a film roll matrix, which is a component of the post-projection matrix.

filmTranslateH (fth) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The horizontal film translation. Values are normalized to the viewing area.
filmTranslateV (ftv) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The vertical film translation. Values are normalized to the viewing area.
focalLength (fl) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This is the distance along the lens axis between the lens and the film plane when “focal distance” is infinitely large. This is an optical property of the lens. This double precision parameter is always specified in millimeters.

focusDistance (fd) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the focus at a certain distance in front of the camera.
homeCommand (hc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specify the command to execute when “viewSet -home” is applied to this camera. All occurances of “%camera” will be replaced with the cameras name before viewSet runs the command.

horizontalFieldOfView (hfv) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This is the film back width as seen by the lens when focused at infinity (ie., focal length away) measured as an angle. Note that it has nothing to do with pixels or the digital image or any aspects. Angle of view is a derived field, that is, it is not used internally by Alias and can be completely determined from other information. It is included as a convenience for the user. Its derivation is aov = 2 * atan( fbw / (2 * f) ) where “aov” is the angle of view, “fbw” is the film back width and “f” is the focal length.

| .. |
hfa)** | float | .. image:: /images/create.gif |
| | .. image:: /images/query.gif |
| | .. image:: /images/edit.gif |
 

The horizontal width of the camera’s film plane. The camera’s film is located on the film plane. The extent of the film which will be exposed to an image of the scene in front of the lens is limited to a rectangular area described by the film back. This double precision parameter is always specified in inches.

horizontalFilmOffset (hfo) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Horizontal offset from the center of the film back. Normally the film back will be centered on the lens axis. However, this need not be so. Film offset is the displacement of the center of the film back from the lens axis, also measured in inches. Note that offsetting the film back will distort the image, but will not alter the focus. This double precision parameter is always specified in inches.

horizontalPan (hpn) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Horizontal 2D camera pan (inches)
horizontalRollPivot (hrp) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

The horizontal pivot point from the center of the film back. The pivot point is used during rotation of the film back. The pivot is the point where the rotation occurs around. This double precision parameter corresponds to the normalized viewport. This value is a part of the post projection matrix.

horizontalShake (hs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Another horizontal offset from the center of the film back, which can be used and stored on the camera in addition to the horizonal film offset attribute. This allows for film-based camera shake internal to the camera. This works in exactly the same units and coordinates that the film offset attribute does. The effect of this attribute is toggled by the shake enabled attribute.

journalCommand (jc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Journal interactive camera commands. Commands can be undone when a camera is journaled.
lensSqueezeRatio (lsr) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This is presently just an information field in the camera editor is meant to convey the horizontal distortion of the anamorphic lens normally used with some film formats. If it were used, it would do something like pixel aspect. Remember however that lens distortion (intentional or not) is slightly different than the output hardware’s quantization. The fact that a “net” distortion parameter could be used for both may or may not confuse the issue.

motionBlur (mb) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Determines whether the camera’s image is motion blured (as opposed to an object’s image). For example, if you want to blur the camera movement when you are performing a flyby.

name (n) unicode ../../../_images/query.gif ../../../_images/edit.gif
   
nearClipPlane (ncp) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify the distance to the NEAR clipping plane.
nearFocusDistance (nfd) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Linear distance to the near focus plane.
orthographic (o) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Activate the orthographic camera.
orthographicWidth (ow) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the orthographic projection width.
overscan (ovr) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the percent of overscan.
panZoomEnabled (pze) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Toggle camera 2D pan and zoom
position (p) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Three linear values can be specified to translate the camera.
postScale (pts) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The post-scale value. This value multiplied against the computed projection matrix. It is applied after the the film roll.
preScale (prs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The pre-scale value. The value is multiplied against the computed projection matrix. It is applied before the film roll.
renderPanZoom (rpz) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Toggle camera 2D pan and zoom in render
rotation (rot) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Three angular values can be specified to rotate the camera.
shakeEnabled (se) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Toggles the effect of the horizontal and vertical shake attributes.
shakeOverscan (so) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Controls the amount of overscan in the output rendered image. For use when adding film-based camera shake. Acts as a multiplier to the film aperture on the camera.

shakeOverscanEnabled (soe) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Toggles the effect of the shake overscan attribute.
shutterAngle (sa) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specify the shutter angle (degrees).
startupCamera (sc) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

A startup camera is marked undeletable and implicit. This flag can be used to set or query the startup state of a camera. There must always be at least one startup camera.

| .. |
hit)** | float | .. image:: /images/create.gif |
| | .. image:: /images/query.gif |
| | .. image:: /images/edit.gif |
 
A film-back offset for use in stereo camera rigs.
| .. |
she)** | bool | .. image:: /images/create.gif |
| | .. image:: /images/query.gif |
| | .. image:: /images/edit.gif |
 
Toggles the effect of the stereo HIT attribute.
verticalFieldOfView (vfv) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the vertical field of view.
verticalFilmAperture (vfa) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The vertical height of the camera’s film plane. This double precision parameter is always specified in inches.
verticalFilmOffset (vfo) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Vertical offset from the center of the film back. This double precision parameter is always specified in inches.
verticalLock (vl) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Lock the size of the vertical film aperture.
verticalPan (vpn) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Vertical 2D camera pan (inches)
verticalRollPivot (vrp) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Vertical pivot point used for rotating the film back. This double precision parameter corresponds to the normalized viewport. This value is used to compute the film roll matrix, which is a component of the post projection matrix.

verticalShake (vs) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Vertical offset from the center of the film back. See horizontal shake attribute description. This is toggled by the shake enabled attribute.
worldCenterOfInterest (wci) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Camera world center of interest point.
worldUp (wup) float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Camera world up vector.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
zoom (zom) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The percent over the film viewable frustum to display

Derived from mel command maya.cmds.camera

Example:

import pymel.core as pm

import maya.cmds as cmds

# Create a camera and get the shape name.
cameraName = pm.camera()
cameraShape = cameraName[1]

# Get the focal length of the camera.
focalLength = pm.camera(cameraShape, q=True, fl=True)

# Change the film fit type.
pm.camera( cameraShape, e=True, ff='overscan' )

Previous topic

pymel.core.rendering.binMembership

Next topic

pymel.core.rendering.cameraSet

Core

Core Modules

Other Modules

This Page