OpenMaya.MFnCamera Class Reference

Class Description

Function set for cameras.

Method resolution order:
-   MFnCamera
-   MFnDagNode
-   MFnDependencyNode
-   MFnBase
-   __builtin__.object
+ Inheritance diagram for OpenMaya.MFnCamera:

Public Member Functions

__init__ ()
 
aspectRatio ()
 
centerOfInterestPoint ()
 
computeDepthOfField ()
 
copyViewFrom ()
 
create ()
 
eyePoint ()
 
getAspectRatioLimits ()
 
getFilmApertureLimits ()
 
getFilmFrustum ()
 
getFilmFrustumCorners ()
 
getFocalLengthLimits ()
 
getPortFieldOfView ()
 
getRenderingFrustum ()
 
getViewParameters ()
 
getViewingFrustum ()
 
hasSamePerspective ()
 
horizontalFieldOfView ()
 
isOrtho ()
 
postProjectionMatrix ()
 
projectionMatrix ()
 
rightDirection ()
 
set ()
 
setAspectRatio ()
 
setCenterOfInterestPoint ()
 
setEyePoint ()
 
setHorizontalFieldOfView ()
 
setIsOrtho ()
 
setNearFarClippingPlanes ()
 
setVerticalFieldOfView ()
 
upDirection ()
 
verticalFieldOfView ()
 
viewDirection ()
 
- Public Member Functions inherited from OpenMaya.MFnDagNode
__init__ ()
 
addChild ()
 
child ()
 
childCount ()
 
create ()
 
dagPath ()
 
dagRoot ()
 
duplicate ()
 
fullPathName ()
 
getAllPaths ()
 
getConnectedSetsAndMembers ()
 
getPath ()
 
hasChild ()
 
hasParent ()
 
instanceCount ()
 
isChildOf ()
 
isInstanced ()
 
isInstancedAttribute ()
 
isParentOf ()
 
parent ()
 
parentCount ()
 
partialPathName ()
 
removeChild ()
 
removeChildAt ()
 
setObject ()
 
transformationMatrix ()
 
- Public Member Functions inherited from OpenMaya.MFnDependencyNode
__init__ ()
 
absoluteName ()
 
addAttribute ()
 
addExternalContentForFileAttr ()
 
attribute ()
 
attributeClass ()
 
attributeCount ()
 
canBeWritten ()
 
create ()
 
dgCallbackIds ()
 
dgCallbacks ()
 
dgTimer ()
 
dgTimerOff ()
 
dgTimerOn ()
 
dgTimerQueryState ()
 
dgTimerReset ()
 
findAlias ()
 
findPlug ()
 
getAffectedAttributes ()
 
getAffectingAttributes ()
 
getAliasAttr ()
 
getAliasList ()
 
getConnections ()
 
getExternalContent ()
 
hasAttribute ()
 
hasUniqueName ()
 
isFlagSet ()
 
isNewAttribute ()
 
isTrackingEdits ()
 
name ()
 
plugsAlias ()
 
removeAttribute ()
 
reorderedAttribute ()
 
setAlias ()
 
setDoNotWrite ()
 
setExternalContent ()
 
setExternalContentForFileAttr ()
 
setFlag ()
 
setName ()
 
setUuid ()
 
userNode ()
 
uuid ()
 
- Public Member Functions inherited from OpenMaya.MFnBase
__init__ ()
 
hasObj ()
 
object ()
 
setObject ()
 
type ()
 

Static Public Attributes

int kFillFilmFit = 0
 
int kHorizontalFilmFit = 1
 
int kInvalid = 4
 
int kOverscanFilmFit = 3
 
int kRotateTranslate = 0
 
int kTranslateRotate = 1
 
int kVerticalFilmFit = 2
 
- Static Public Attributes inherited from OpenMaya.MFnDagNode
int kNextPos = 255
 
- Static Public Attributes inherited from OpenMaya.MFnDependencyNode
int kTimerMetrics = 9
 
int kTimerTypes = 3
 
int kExtensionAttr = 3
 
int kInvalidAttr = 4
 
int kLocalDynamicAttr = 1
 
int kNormalAttr = 2
 
int kTimerInvalidState = 3
 
int kTimerOff = 0
 
int kTimerOn = 1
 
int kTimerUninitialized = 2
 
int kTimerMetric_callback = 0
 
int kTimerMetric_callbackNotViaAPI = 6
 
int kTimerMetric_callbackViaAPI = 5
 
int kTimerMetric_compute = 1
 
int kTimerMetric_computeDuringCallback = 7
 
int kTimerMetric_computeNotDuringCallback = 8
 
int kTimerMetric_dirty = 2
 
int kTimerMetric_draw = 3
 
int kTimerMetric_fetch = 4
 
int kTimerType_count = 2
 
int kTimerType_inclusive = 1
 
int kTimerType_self = 0
 

Properties

 cameraScale
 
 centerOfInterest
 
 fStop
 
 farClippingPlane
 
 farFocusDistance
 
 filmFit
 
 filmFitOffset
 
 filmRollOrder
 
 filmRollValue
 
 filmTranslateH
 
 filmTranslateV
 
 focalLength
 
 focusDistance
 
 horizontalFilmAperture
 
 horizontalFilmOffset
 
 horizontalPan
 
 horizontalRollPivot
 
 horizontalShake
 
 isClippingPlanes
 
 isDepthOfField
 
 isDisplayFilmGate
 
 isDisplayGateMask
 
 isMotionBlur
 
 isVerticalLock
 
 lensSqueezeRatio
 
 nearClippingPlane
 
 nearFocusDistance
 
 orthoWidth
 
 overscan
 
 panZoomEnabled
 
 postScale
 
 preScale
 
 renderPanZoom
 
 shakeEnabled
 
 shakeOverscan
 
 shakeOverscanEnabled
 
 shutterAngle
 
 stereoHIT
 
 stereoHITEnabled
 
 tumblePivot
 
 usePivotAsLocalSpace
 
 verticalFilmAperture
 
 verticalFilmOffset
 
 verticalPan
 
 verticalRollPivot
 
 verticalShake
 
 zoom
 
- Properties inherited from OpenMaya.MFnDagNode
 boundingBox
 
 inModel
 
 inUnderWorld
 
 isInstanceable
 
 isIntermediateObject
 
 objectColor
 
 objectColorRGB
 
 objectColorType
 
 useObjectColor
 
- Properties inherited from OpenMaya.MFnDependencyNode
 isDefaultNode
 
 isFromReferencedFile
 
 isLocked
 
 isShared
 
 namespace
 
 pluginName
 
 typeId
 
 typeName
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenMaya.MFnDependencyNode
allocateFlag ()
 
classification ()
 
deallocateAllFlags ()
 
deallocateFlag ()
 

Constructor & Destructor Documentation

OpenMaya.MFnCamera.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMaya.MFnCamera.aspectRatio ( )
aspectRatio() -> float

Returns the aspect ratio for the camera.
OpenMaya.MFnCamera.centerOfInterestPoint ( )
centerOfInterestPoint(space=kObject) -> MPoint

Returns the center of interest point for the camera.

* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.computeDepthOfField ( )
computeDepthOfField(nearLimit=None) -> self

Compute the depth of field

* nearLimit (float) - the near limit
OpenMaya.MFnCamera.copyViewFrom ( )
copyViewFrom(otherCamera) -> self

Copy the camera settings related to the perspective from the given camera view.

This method will only work when the world space information for the camera is available, i.e. when the function set has been initialized with a DAG path.

* otherCamera (MDagPath) - Camera to copy view from
OpenMaya.MFnCamera.create ( )
create(parent=None) -> MObject

Creates a perspective camera. A parent can be specified for the new camera, otherwise a transform is created.

The camera is positioned at (0, 0, 0), its center of interest at (0, 0, -1), which implies that the view-direction is pointing in the direction of the negative z-axis, and its up-direction along the positive Y axis.

* parent (MObject) - The parent of the new camera
OpenMaya.MFnCamera.eyePoint ( )
eyePoint(space=kObject) -> MPoint

Returns the eye point for the camera.

* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.getAspectRatioLimits ( )
getAspectRatioLimits() -> (float, float)

Returns the minimum and maximum aspect ratio limits for the camera.
OpenMaya.MFnCamera.getFilmApertureLimits ( )
getFilmApertureLimits() -> (float, float)

Returns the maximum and minimum film aperture limits for the camera.
OpenMaya.MFnCamera.getFilmFrustum ( )
getFilmFrustum(distance, applyPanZoom=False) -> (float, float, float, float)

Returns the film frustum for the camera (horizontal size, vertical size, horizontal offset and vertical offset). The frustum defines the projective transformation.

* distance (float) - Specifies the focal length
* applyPanZoom (bool) - specifies whether to apply 2D pan/zoom
OpenMaya.MFnCamera.getFilmFrustumCorners ( )
getFilmFrustumCorners(distance, applyPanZoom=False) -> MPointArray

Returns the film frustum for the camera. The frustum defines the projective transformation.

 element 0 is the bottom left
 element 1 is the top left
 element 2 is the top right
 element 3 is the bottom right

* distance (float) - Specifies the focal length
* applyPanZoom (bool) - specifies whether to apply 2D pan/zoom
OpenMaya.MFnCamera.getFocalLengthLimits ( )
getFocalLengthLimits() -> (float, float)

Returns the maximum and minimum focal length limits for the camera.
OpenMaya.MFnCamera.getPortFieldOfView ( )
getPortFieldOfView(int, int) -> (float, float)

Returns the horizontal and vertical field of view in radians from the given viewport width and height.

* width (int) - width of viewport
* height (int) - height of viewport
OpenMaya.MFnCamera.getRenderingFrustum ( )
getRenderingFrustum(windowAspect) -> (float, float, float, float)

Returns the rendering frustum (left, right, bottom and top) for the camera.
This is the frustum that the maya renderer uses.

* windowAspect (float) - windowAspect
OpenMaya.MFnCamera.getViewingFrustum ( )
getViewingFrustum(windowAspect, applyOverscan=False, applySqueeze=False, applyPanZoom=False) -> (float, float, float, float)

Returns the viewing frustum (left, right, bottom and top) for the camera.

* windowAspect (float) - windowAspect
* applyOverscan (bool) - specifies whether to apply overscan
* applySqueeze (bool) - specifies whether to apply the lens squeeze ratio of the camera
* applyPanZoom (bool) - specifies whether to apply 2D pan/zoom
OpenMaya.MFnCamera.getViewParameters ( )
getViewParameters(windowAspect, applyOverscan=False, applySqueeze=False, applyPanZoom=False) -> (float, float, float, float)

Returns the intermediate viewing frustum (apertureX, apertureY, offsetX and offsetY) parameters for the camera. The aperture and offset are used by getViewingFrustum() and getRenderingFrustum() to compute the extent (left, right, top, bottom) of the frustum in the following manner:

 left = focal_to_near * (-0.5*apertureX + offsetX)
 right = focal_to_near * (0.5*apertureX + offsetX)
 bottom = focal_to_near * (-0.5*apertureY + offsetY)
 top = focal_to_near * (0.5*apertureY + offsetY)

Here, focal_to_near is equal to cameraScale if the camera is orthographic, or it is equal to ((nearClippingPlane / (focalLength * MM_TO_INCH)) * cameraScale) where MM_TO_INCH equals 0.03937.

* windowAspect (float) - windowAspect
* applyOverscan (bool) - specifies whether to apply overscan
* applySqueeze (bool) - specifies whether to apply the lens squeeze ratio of the camera
* applyPanZoom (bool) - specifies whether to apply 2D pan/zoom
OpenMaya.MFnCamera.hasSamePerspective ( )
hasSamePerspective(otherCamera) -> bool

Returns True if the camera has same perspective settings as the given camera.

This method will only work when the world space information for the camera is available, i.e. when the function set has been initialized with a DAG path.

* otherCamera (MDagPath) - Camera to compare perspective with
OpenMaya.MFnCamera.horizontalFieldOfView ( )
horizontalFieldOfView() -> float

Returns the horizontal field of view for the camera.
OpenMaya.MFnCamera.isOrtho ( )
isOrtho() -> bool

Returns True if the camera is in orthographic mode.
OpenMaya.MFnCamera.postProjectionMatrix ( )
postProjectionMatrix(context=None) -> MFloatMatrix

Returns the post projection matrix used to compute film roll on the film back plane.

* context (MDGContext) - DG time-context to specify time of evaluation
OpenMaya.MFnCamera.projectionMatrix ( )
projectionMatrix(context=None) -> MFloatMatrix

Returns the orthographic or perspective projection matrix for the camera.
The projection matrix that maya's software renderer uses is almost identical to the OpenGL projection matrix. The difference is that maya uses a left hand coordinate system and so the entries [2][2] and [3][2] are negated.

* context (MDGContext) - DG time-context to specify time of evaluation
OpenMaya.MFnCamera.rightDirection ( )
rightDirection(space=kObject) -> MVector

Returns the right direction vector for the camera.

* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.set ( )
set(wsEyeLocation, wsViewDirection, wsUpDirection, horizFieldOfView, aspectRatio) -> self

Convenience routine to set the camera viewing parameters. The specified values should be in world space where applicable.

This method will only work when the world space information for the camera is available, i.e. when the function set has been initialized with a DAG path.

* wsEyeLocation (MPoint) - Eye location to set in world space
* wsViewDirection (MVector) - View direction to set in world space
* wsUpDirection (MVector) - Up direction to set in world space
* horizFieldOfView (float) - The horizontal field of view to set
* aspectRatio (float) - The aspect ratio to set
OpenMaya.MFnCamera.setAspectRatio ( )
setAspectRatio(aspectRatio) -> self

Set the aspect ratio of the View.  The aspect ratio is expressed as width/height.  This also modifies the entity's scale transformation to reflect the new aspect ratio.

* aspectRatio (float) - The aspect ratio to be set
OpenMaya.MFnCamera.setCenterOfInterestPoint ( )
setCenterOfInterestPoint(centerOfInterest, space=kObject) -> self

Positions the center-of-interest of the camera keeping the eye-point fixed in space. This method changed the orientation and translation of the camera's transform attributes as well as the center-of-interest distance.

This method will only work when the world space information for the camera is available, i.e. when the function set has been initialized with a DAG path.

* centerOfInterest (MPoint) - Center of interest point to be set
* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.setEyePoint ( )
setEyePoint(eyeLocation, space=kObject) -> self

Positions the eye-point of the camera keeping the center of interest fixed in space. This method changed the orientation and translation of the camera's transform attributes as well as the center-of-interest distance.

This method will only work when the world space information for the camera is available, i.e. when the function set has been initialized with a DAG path.

* eyeLocation (MPoint) - The eye location to set
* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.setHorizontalFieldOfView ( )
setHorizontalFieldOfView(fov) -> self

Sets the horizontal field of view for the camera.

* fov (float) - The horizontal field of view value to be set
OpenMaya.MFnCamera.setIsOrtho ( )
setIsOrtho(orthoState, useDist=None) -> self

Switch the camera in and out of orthographic mode.  When the switch happens, the camera has to calculate a new fov or ortho width, each of which is based on the other and a set distance.  The caller can specify the distance; otherwise the center of interest is used.

* orthoState (bool) - If True then the camera will be orthographic
* useDist (float) - distance to use.
OpenMaya.MFnCamera.setNearFarClippingPlanes ( )
setNearFarClippingPlanes(near, far) -> self

Set the distances to the Near and Far Clipping Planes.

* near (float) - The near clipping plane value to be set
* far (float) - The far clipping plane value to be set
OpenMaya.MFnCamera.setVerticalFieldOfView ( )
setVerticalFieldOfView(fov) -> self

Sets the vertical field of view for the camera.

* fov (float) - The vertical field of view value to be set
OpenMaya.MFnCamera.upDirection ( )
upDirection(space=kObject) -> MVector

Returns the up direction vector for the camera.

* space (int) - Specifies the coordinate system for this operation
OpenMaya.MFnCamera.verticalFieldOfView ( )
verticalFieldOfView() -> float

Returns the vertical field of view for the camera.
OpenMaya.MFnCamera.viewDirection ( )
viewDirection(space=kObject) -> MVector

Returns the view direction for the camera

* space (int) - Specifies the coordinate system for this operation

Property Documentation

OpenMaya.MFnCamera.cameraScale
static
 The camera scale.
OpenMaya.MFnCamera.centerOfInterest
static
 The linear distance from the camera's eye point to the center of interest.
OpenMaya.MFnCamera.farClippingPlane
static
 The distance to the far clipping plane.
OpenMaya.MFnCamera.farFocusDistance
static
 The farthest distance within the well-focus region
OpenMaya.MFnCamera.filmFit
static
 How the digital image is to be fitted to the film back.
 Valid values:
 * kFillFilmFit           The system calculates both horizontal and vertical fits and then applies the one that makes the digital image larger than the film back.
 * kHorizontalFilmFit     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.
 * kVerticalFilmFit       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.
 * kOverscanFilmFit       Over-scanning 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.
OpenMaya.MFnCamera.filmFitOffset
static
 The film fit offset for the camera.
OpenMaya.MFnCamera.filmRollOrder
static
 The order in which the film back rotation is applied with respect to the pivot point.
 Valid values:
 * kRotateTranslate      The film back is first rotated before it is translated by the pivot value.
 * kTranslateRotate      The film back is translated by the pivot before it is rotated.
OpenMaya.MFnCamera.filmRollValue
static
 The film roll value for film back.
OpenMaya.MFnCamera.filmTranslateH
static
 The horizontal film translate value.  This value corresponds to the normalized viewport.
OpenMaya.MFnCamera.filmTranslateV
static
 The vertical film translate value. This value corresponds to the normalized viewport, [-1,1].
OpenMaya.MFnCamera.focalLength
static
 The focal length for the camera.
 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. Specified in millimeters.
OpenMaya.MFnCamera.focusDistance
static
 The focus distance for the camera. This value sets the focus at a certain distance in front of the camera.
OpenMaya.MFnCamera.fStop
static
 The f-stop value for the camera.
OpenMaya.MFnCamera.horizontalFilmAperture
static
 The horizontal film aperture for the camera.
OpenMaya.MFnCamera.horizontalFilmOffset
static
 The horizontal offset of the film. Unit used is inches.
OpenMaya.MFnCamera.horizontalPan
static
 The camera 2D horizontal pan value. Unit is inches.
OpenMaya.MFnCamera.horizontalRollPivot
static
 The horizontal roll pivot for film back roll.
OpenMaya.MFnCamera.horizontalShake
static
 The horizontal offset of the film due to the shake attribute. Unit used is inches.
OpenMaya.MFnCamera.isClippingPlanes
static
 Whether or not manual clipping planes are activated.
OpenMaya.MFnCamera.isDepthOfField
static
 Whether or not the depth of field calculation is performed for the camera.
OpenMaya.MFnCamera.isDisplayFilmGate
static
 Whether or not the film gate icons are displayed when looking through the camera.
OpenMaya.MFnCamera.isDisplayGateMask
static
 Whether or not the film gate is displayed shaded.
OpenMaya.MFnCamera.isMotionBlur
static
 Wheter or not motion blur is on/off for the camera.
OpenMaya.MFnCamera.isVerticalLock
static
 Determines if vertical lock is turned on for the camera.
OpenMaya.MFnCamera.lensSqueezeRatio
static
 The lens squeeze ratio for the camera
OpenMaya.MFnCamera.nearClippingPlane
static
 The distance to the near clipping plane.
OpenMaya.MFnCamera.nearFocusDistance
static
 The nearest distance within the well-focus region
OpenMaya.MFnCamera.orthoWidth
static
 The orthographic projection width.
OpenMaya.MFnCamera.overscan
static
 The percent of overscan for this camera.
OpenMaya.MFnCamera.panZoomEnabled
static
 The toggle value for the camera 2D pan/zoom enabled attribute.
 If this attribute is False, the 2D pan/zoom values are ignored by the camera.
OpenMaya.MFnCamera.postScale
static
 The post projection matrix's post-scale value.
OpenMaya.MFnCamera.preScale
static
 The post projection matrix's pre-scale value.
OpenMaya.MFnCamera.renderPanZoom
static
 The toggle value for the camera render 2D pan/zoom attribute.
 If this attribute is False, the 2D pan/zoom values will not affect the output render.
OpenMaya.MFnCamera.shakeEnabled
static
 The toggle value for the camera shake enabled attribute.
 If this attribute is False, the horizontalShake and verticalShake values are ignored by the camera.
OpenMaya.MFnCamera.shakeOverscan
static
 The camera shake overscan value. Unit is a multiplier to the film aperture.
OpenMaya.MFnCamera.shakeOverscanEnabled
static
 The toggle value for the camera shake overscan attribute.
 If this attribute is False, the shakeOverscan value is ignored by the camera.
OpenMaya.MFnCamera.shutterAngle
static
 The shutter angle which is one of the variables used to compute motion blur. The shutter angle is specified in radians.
OpenMaya.MFnCamera.stereoHIT
static
 The camera stereo horizontal image translation (stereo HIT) value.  Unit is inches.
OpenMaya.MFnCamera.stereoHITEnabled
static
 The toggle value for the stereo HIT enabled attribute.
 If this attribute is False, the stereoHIT value is ignored by the camera.
OpenMaya.MFnCamera.tumblePivot
static
 The tumble pivot value for the camera. The pivot value will be in world space coordinates unless usePivotAsLocalSpace is True in which case the pivot is a relative offset.
OpenMaya.MFnCamera.usePivotAsLocalSpace
static
 The local axis tumble setting for this camera.True if using local space tumbling for this camera, or False if using the current global tumble setting in Maya.
OpenMaya.MFnCamera.verticalFilmAperture
static
 The vertical film aperture for the camera.
OpenMaya.MFnCamera.verticalFilmOffset
static
 The vertical offset of the film. Unit used is inches.
OpenMaya.MFnCamera.verticalPan
static
 The camera 2D vertical pan value. Unit is inches.
OpenMaya.MFnCamera.verticalRollPivot
static
 The vertical roll pivot for film back roll.
OpenMaya.MFnCamera.verticalShake
static
 The vertical film-based camera shake value. Unit used is inches.
OpenMaya.MFnCamera.zoom
static
 The camera 2D zoom value, which is the percent over the film viewable frustum to display