C++ API Reference

Function set for cameras. More...

#include <MFnCamera.h>

+ Inheritance diagram for MFnCamera:

Public Types

enum  FilmFit {
  kFillFilmFit, kHorizontalFilmFit, kVerticalFilmFit, kOverscanFilmFit,
  kInvalid
}
 Specifies how to fit the digital image to the film back. More...
 
enum  RollOrder { kRotateTranslate, kTranslateRotate }
 Order in which film back rotation and its transformation by the pivot point are applied. More...
 
- Public Types inherited from MFnDagNode
enum  { kNextPos = 0xff }
 Anonymous enum to store constant values. More...
 
enum  MObjectColorType { kUseDefaultColor = 0, kUseIndexColor, kUseRGBColor }
 Enum to set how an object is colored. More...
 
- Public Types inherited from MFnDependencyNode
enum  MAttrClass { kLocalDynamicAttr = 1, kNormalAttr, kExtensionAttr, kInvalidAttr }
 Specifies the scope of the attribute. More...
 
enum  MdgTimerState { kTimerOff, kTimerOn, kTimerUninitialized, kTimerInvalidState }
 Possible states for the node's timer. More...
 
enum  MdgTimerMetric {
  kTimerMetric_callback, kTimerMetric_compute, kTimerMetric_dirty, kTimerMetric_draw,
  kTimerMetric_fetch, kTimerMetric_callbackViaAPI, kTimerMetric_callbackNotViaAPI, kTimerMetric_computeDuringCallback,
  kTimerMetric_computeNotDuringCallback, kTimerMetrics
}
 The different timer metrics which can be queried. More...
 
enum  MdgTimerType { kTimerType_self, kTimerType_inclusive, kTimerType_count, kTimerTypes }
 The types of timers which can be queried. More...
 

Public Member Functions

virtual MFn::Type type () const
 Function set type. More...
 
virtual ~MFnCamera ()
 Destructor. More...
 
 MFnCamera ()
 Default constructor.
 
 MFnCamera (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
 MFnCamera (const MDagPath &object, MStatus *ret=NULL)
 Constructor. More...
 
MObject create (MStatus *ReturnStatus=NULL)
 Creates a perspective camera and a transform to parent it. More...
 
MObject create (MObject &parent, MStatus *ReturnStatus=NULL)
 Creates a perspective camera. More...
 
MPoint eyePoint (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
 Returns the eye point for the camera. More...
 
MVector viewDirection (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
 Returns the view direction for the camera. More...
 
MVector upDirection (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
 Returns the up direction vector for the camera. More...
 
MVector rightDirection (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
 Returns the right direction vector for the camera. More...
 
MPoint centerOfInterestPoint (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
 Returns the center of interest point for the camera. More...
 
MStatus set (const MPoint &wsEyeLocation, const MVector &wsViewDirection, const MVector &wsUpDirection, double horizFieldOfView, double aspectRatio)
 Convenience routine to set the camera viewing parameters. More...
 
MStatus setEyePoint (const MPoint &eyeLocation, MSpace::Space space=MSpace::kObject)
 Positions the eye-point of the camera keeping the center of interest fixed in space. More...
 
MStatus setCenterOfInterestPoint (const MPoint &centerOfInterest, MSpace::Space space=MSpace::kObject)
 Positions the center-of-interest of the camera keeping the eye-point fixed in space. More...
 
bool hasSamePerspective (const MDagPath &otherCamera, MStatus *ReturnStatus=NULL)
 Returns true if the camera has same perspective settings as the given camera. More...
 
MStatus copyViewFrom (const MDagPath &otherCamera)
 Copy the camera settings related to the perspective from the given camera view. More...
 
MStatus getFilmFrustum (double distance, MPointArray clipPlanes, bool applyPanZoom=false) const
 This method is not available in Python. More...
 
MStatus getFilmFrustum (double distance, double &hSize, double &vSize, double &hOffset, double &vOffset, bool applyPanZoom=false) const
 Returns the film frustum for the camera. More...
 
MStatus getPortFieldOfView (int width, int height, double &horizontalFOV, double &verticalFOV) const
 Compute the horizontal and vertical field of view in radians from the given viewport width and height. More...
 
MStatus getViewParameters (double windowAspect, double &apertureX, double &apertureY, double &offsetX, double &offsetY, bool applyOverscan=false, bool applySqueeze=false, bool applyPanZoom=false) const
 Computes and returns the intermediate viewing frustum parameters for the camera. More...
 
MStatus getViewingFrustum (double windowAspect, double &left, double &right, double &bottom, double &top, bool applyOverscan=false, bool applySqueeze=false, bool applyPanZoom=false) const
 Computes and returns the viewing frustum for the camera. More...
 
MStatus getRenderingFrustum (double windowAspect, double &left, double &right, double &bottom, double &top) const
 Computes and returns the rendering frustum for the camera. More...
 
MFloatMatrix projectionMatrix (MStatus *ReturnStatus=NULL) const
 Returns the orthographic or perspective projection matrix for the camera. More...
 
MStatus setHorizontalFilmAperture (double hFilmAperture)
 Change the horizontal size of the camera aperture. More...
 
double horizontalFilmAperture (MStatus *ReturnStatus=NULL) const
 Returns the horizontal film aperture for the camera. More...
 
MStatus setVerticalFilmAperture (double vFilmAperture)
 Change the vertical size of the camera aperture. More...
 
double verticalFilmAperture (MStatus *ReturnStatus=NULL) const
 Returns the vertical film aperture for the camera. More...
 
MStatus getFilmApertureLimits (double &min, double &max) const
 Returns the maximum and minimum film aperture limits for the camera. More...
 
MStatus setAspectRatio (double aspectRatio)
 Set the aspect ratio of the View. More...
 
double aspectRatio (MStatus *ReturnStatus=NULL) const
 Returns the aspect ratio for the camera. More...
 
MStatus getAspectRatioLimits (double &min, double &max) const
 Returns the minimum and maximum aspect ratio limits for the camera. More...
 
MStatus setVerticalLock (bool lockFlag)
 Sets the vertical lock to on or off for the camera. More...
 
bool isVerticalLock (MStatus *ReturnStatus=NULL) const
 Determines if vertical lock is turned on for the camera. More...
 
double horizontalFilmOffset (MStatus *ReturnStatus=NULL) const
 Returns the horizontal offset of the film. More...
 
MStatus setHorizontalFilmOffset (double hOffset)
 Change the horizontal offset of the film. More...
 
double verticalFilmOffset (MStatus *ReturnStatus=NULL) const
 Change the vertical offset of the film. More...
 
MStatus setVerticalFilmOffset (double vOffset)
 Change the vertical offset of the film. More...
 
bool shakeEnabled (MStatus *ReturnStatus=NULL) const
 Returns the toggle value for the camera shake enabled attribute. More...
 
MStatus setShakeEnabled (bool enabled)
 Changes the toggle value for the camera shake enabled attribute. More...
 
double horizontalShake (MStatus *ReturnStatus=NULL) const
 Returns the horizontal offset of the film due to the shake attribute. More...
 
MStatus setHorizontalShake (double hOffset)
 Change the horizontal film-based camera shake value. More...
 
double verticalShake (MStatus *ReturnStatus=NULL) const
 Change the vertical film-based camera shake value. More...
 
MStatus setVerticalShake (double vOffset)
 Changes the vertical film-based camera shake value. More...
 
bool shakeOverscanEnabled (MStatus *ReturnStatus=NULL) const
 Returns the toggle value for the camera shake overscan attribute. More...
 
MStatus setShakeOverscanEnabled (bool enabled)
 Changes the toggle value for the camera shake overscan enabled attribute. More...
 
double shakeOverscan (MStatus *ReturnStatus=NULL) const
 Returns the camera shake overscan value. More...
 
MStatus setShakeOverscan (double vOffset)
 Changes the camera shake overscan value. More...
 
bool panZoomEnabled (MStatus *ReturnStatus=NULL) const
 Return the toggle value for the camera 2D pan/zoom enabled attribute. More...
 
MStatus setPanZoomEnabled (bool enabled)
 Changes the toggle value for the camera 2D pan/zoom enabled attribute. More...
 
bool renderPanZoom (MStatus *ReturnStatus=NULL) const
 Return the toggle value for the camera render 2D pan/zoom attribute. More...
 
MStatus setRenderPanZoom (bool render)
 Changes the toggle value for the camera render 2D pan/zoom enabled attribute. More...
 
double horizontalPan (MStatus *ReturnStatus=NULL) const
 Return the camera 2D horizontal pan value. More...
 
MStatus setHorizontalPan (double hPan)
 Changes the camera 2D horizontal pan value. More...
 
double verticalPan (MStatus *ReturnStatus=NULL) const
 Return the camera 2D vertical pan value. More...
 
MStatus setVerticalPan (double vPan)
 Changes the camera 2D vertical pan value. More...
 
double zoom (MStatus *ReturnStatus=NULL) const
 Return the camera 2D zoom value, which is the percent over the film viewable frustum to display. More...
 
MStatus setZoom (double zoom)
 Changes the camera 2D zoom value. More...
 
bool stereoHITEnabled (MStatus *ReturnStatus=NULL) const
 Returns the toggle value for the stereo HIT enabled attribute. More...
 
MStatus setStereoHITEnabled (bool enabled)
 Changes the toggle value for the stereo HIT enabled attribute. More...
 
double stereoHIT (MStatus *ReturnStatus=NULL) const
 Returns the camera stereo horizontal image translation (stereo HIT) value. More...
 
MStatus setStereoHIT (double vOffset)
 Changes the camera stereo horizontal image translation (stereo HIT) value. More...
 
MStatus setFilmFit (FilmFit filmFit)
 Sets how the digital image is to be fitted to the film back. More...
 
FilmFit filmFit (MStatus *ReturnStatus=NULL) const
 Returns how the digital image is being fitted to the film back. More...
 
MStatus setFilmFitOffset (double filmFitOffset)
 Set the film fit offset for the camera. More...
 
double filmFitOffset (MStatus *ReturnStatus=NULL) const
 Returns the film fit offset for the camera. More...
 
MStatus setOverscan (double overscan)
 Set the percent of overscan for this camera. More...
 
double overscan (MStatus *ReturnStatus=NULL) const
 Returns the percent of overscan for this camera. More...
 
MStatus setHorizontalRollPivot (double horizontalRollPivot)
 Set the horizontal roll pivot for film back roll. More...
 
double horizontalRollPivot (MStatus *ReturnStatus=NULL) const
 Returns the current horizontal roll pivot value. More...
 
MStatus setVerticalRollPivot (double verticalRollPivot)
 Set the vertical roll pivot for film back roll. More...
 
double verticalRollPivot (MStatus *ReturnStatus=NULL) const
 Returns the vertical roll pivot's value. More...
 
MStatus setFilmRollValue (double filmRollValue)
 Set the film roll value for film back. More...
 
double filmRollValue (MStatus *ReturnStatus=NULL) const
 Returns the current roll value in radians. More...
 
MStatus setFilmRollOrder (RollOrder filmRollOrder)
 Assign the order in which the film back rotation is applied with respect to the pivot point. More...
 
RollOrder filmRollOrder (MStatus *ReturnStatus=NULL) const
 Returns the current roll order. More...
 
MStatus setPreScale (double sf)
 Set the pre scale value. More...
 
double preScale (MStatus *ReturnStatus=NULL) const
 Return the post projection matrix's pre-scale value. More...
 
MStatus setPostScale (double sf)
 Set the post scale value. More...
 
double postScale (MStatus *ReturnStatus=NULL) const
 Return the post projection matrix's post-scale value. More...
 
MStatus setFilmTranslateH (double translate)
 Set the horizontal film translate. More...
 
double filmTranslateH (MStatus *ReturnStatus=NULL) const
 Returns the horizontal film translate value. More...
 
MStatus setFilmTranslateV (double translate)
 Set the vertical film translate. More...
 
double filmTranslateV (MStatus *ReturnStatus=NULL) const
 Returns the vertical film translate value. More...
 
MFloatMatrix postProjectionMatrix (MStatus *ReturnStatus=NULL) const
 Returns the post projection matrix used to compute film roll on the film back plane. More...
 
MStatus setDisplayGateMask (bool displayGateMask)
 Activate shaded display of the film or resolution gate mask when looking through the camera. More...
 
bool isDisplayGateMask (MStatus *ReturnStatus=NULL) const
 Determines if the film gate is displayed shaded. More...
 
MStatus setDisplayFilmGate (bool displayFilmGate)
 Activate display of the film gate icons when looking through the camera. More...
 
bool isDisplayFilmGate (MStatus *ReturnStatus=NULL) const
 Determines if the film gate icons are displayed when looking through the camera. More...
 
MStatus setHorizontalFieldOfView (double fov)
 Sets the horizontal field of view for the camera. More...
 
double horizontalFieldOfView (MStatus *ReturnStatus=NULL) const
 Returns the horizontal field of view for the camera. More...
 
MStatus setVerticalFieldOfView (double fov)
 Sets the vertical field of view for the camera. More...
 
double verticalFieldOfView (MStatus *ReturnStatus=NULL) const
 Returns the vertical field of view for the camera. More...
 
MStatus setFocalLength (double focalLength)
 Sets the focal length for the camera. More...
 
double focalLength (MStatus *ReturnStatus=NULL) const
 Returns the focal length for the camera. More...
 
MStatus getFocalLengthLimits (double &min, double &max) const
 Returns the focal length limits for the camera. More...
 
MStatus setLensSqueezeRatio (double lensSqueezeRatio)
 Set the squeeze ratio of the lens. More...
 
double lensSqueezeRatio (MStatus *ReturnStatus=NULL) const
 Returns the lens squeeze ratio for the camera. More...
 
MStatus setClippingPlanes (bool ClippingPlanes)
 Turn on/off manual setting of clip planes. More...
 
bool isClippingPlanes (MStatus *ReturnStatus=NULL) const
 Determines whether manual clipping planes are activated. More...
 
MStatus setNearClippingPlane (double dNear)
 Set the distances to the Near Clipping Plane. More...
 
double nearClippingPlane (MStatus *ReturnStatus=NULL) const
 Returns the distance to the near clipping plane. More...
 
MStatus setFarClippingPlane (double dFar)
 Set the distances to the Far Clipping Plane. More...
 
double farClippingPlane (MStatus *ReturnStatus=NULL) const
 Returns the distance to the far clipping plane. More...
 
MStatus setNearFarClippingPlanes (double dNear, double dFar)
 Set the distances to the Near and Far Clipping Planes. More...
 
MStatus setDepthOfField (bool depthOfField)
 Specifies whether the depth of field calculation is performed for the camera. More...
 
bool isDepthOfField (MStatus *ReturnStatus=NULL) const
 Determines whether the depth of field calculation is performed for the camera. More...
 
MStatus setFStop (double fStop)
 Sets the f-stop value for the camera. More...
 
double fStop (MStatus *ReturnStatus=NULL) const
 Returns the f-stop value for the camera. More...
 
MStatus setFocusDistance (double distance)
 Set the focus at a certain distance in front of the camera. More...
 
double focusDistance (MStatus *ReturnStatus=NULL) const
 Returns the focus distance for the camera. More...
 
MStatus setNearFocusDistance (double nearFocusDistance)
 Set the nearest distance within the well-focus region. More...
 
double nearFocusDistance (MStatus *ReturnStatus=NULL) const
 Returns the linear distance to the near focus plane. More...
 
MStatus setFarFocusDistance (double farFocusDistance)
 Set the farthest distance within the well-focus region. More...
 
double farFocusDistance (MStatus *ReturnStatus=NULL) const
 Returns the linear distance to the far focus plane. More...
 
MStatus computeDepthOfField ()
 
MStatus computeDepthOfField (double nearLimit)
 
MStatus setMotionBlur (bool motionBlur)
 Turns motion blur on/off for the camera. More...
 
bool isMotionBlur (MStatus *ReturnStatus=NULL) const
 Determine if motion blur is on/off for the camera. More...
 
MStatus setShutterAngle (double shutterAngle)
 Change the current shutter angle which is one of the variables used to compute motion blur. More...
 
double shutterAngle (MStatus *ReturnStatus=NULL) const
 Return the current shutter angle which is one of the variables used to compute motion blur. More...
 
MStatus setCenterOfInterest (double dist)
 Set the Center of Interest, which is defined to be a positive distance along the View Direction (i.e., "in front" of the Camera). More...
 
double centerOfInterest (MStatus *ReturnStatus=NULL) const
 Return the linear distance from the camera's eye point to the center of interest. More...
 
MStatus setIsOrtho (bool orthoState)
 Switch the camera in and out of orthographic mode. More...
 
MStatus setIsOrtho (bool orthoState, double useDist)
 Switch the camera in and out of orthographic mode. More...
 
bool isOrtho (MStatus *ReturnStatus=NULL) const
 Determines if the camera is in orthographic mode. More...
 
MStatus setOrthoWidth (double orthoWidth)
 Sets a new width for the ortho camera. More...
 
double orthoWidth (MStatus *ReturnStatus=NULL) const
 Returns the orthographic projection width. More...
 
MStatus setCameraScale (double scale)
 Sets the camera scale. More...
 
double cameraScale (MStatus *ReturnStatus=NULL) const
 Returns the camera scale. More...
 
MStatus setTumblePivot (const MPoint &point)
 The tumble pivot is used for non-local tumble operations. More...
 
MPoint tumblePivot (MStatus *ReturnStatus=NULL) const
 Returns the tumble pivot value for the camera. More...
 
double unnormalizedNearClippingPlane (MStatus *ReturnStatus=NULL) const
 Returns the distance to the near clipping plane. More...
 
double unnormalizedFarClippingPlane (MStatus *ReturnStatus=NULL) const
 Returns the distance to the far clipping plane. More...
 
 MFnCamera (const MObject &object, MStatus *ret=NULL)
 Constructor. More...
 
MStatus setStereo (bool stereo)
 no script support More...
 
bool isStereo (MStatus *ReturnStatus=NULL) const
 no script support More...
 
MStatus setParallelView (bool parallelView)
 obsolete & no script support More...
 
bool isParallelView (MStatus *ReturnStatus=NULL) const
 no script support More...
 
MStatus setEyeOffset (double eyeOffset)
 no script support More...
 
double eyeOffset (MStatus *ReturnStatus=NULL) const
 no script support More...
 
MStatus getFilmFrustum (double distance, MPoint clipPlane[4], bool applyPanZoom=false) const
 No script support. More...
 
MStatus setUsePivotAsLocalSpace (const bool how)
 Local space tumbling specifies that when the camera is tumbled, the camera will rotate about its local axis, offset by the tumblePivot. More...
 
bool usePivotAsLocalSpace (MStatus *ReturnStatus=NULL) const
 Returns the value of the local axis tumble setting for this camera. More...
 
MFloatMatrix postProjectionMatrix (const MDGContext &context, MStatus *ReturnStatus=NULL) const
 Returns the post projection matrix used to compute film roll on the film back plane. More...
 
MFloatMatrix projectionMatrix (const MDGContext &context, MStatus *ReturnStatus=NULL) const
 Returns the orthographic or perspective projection matrix for the camera. More...
 
- Public Member Functions inherited from MFnDagNode
virtual ~MFnDagNode ()
 Destructor. More...
 
 MFnDagNode ()
 Class Constructor. More...
 
 MFnDagNode (MObject &object, MStatus *ret=NULL)
 This method is not available in Python. More...
 
 MFnDagNode (const MDagPath &object, MStatus *ret=NULL)
 Class Constructor. More...
 
MObject create (const MTypeId &typeId, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL)
 Creates a new DAG node with the given type tag. More...
 
MObject create (const MTypeId &typeId, const MString &name, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL)
 Creates a new DAG node with the given type tag. More...
 
MObject create (const MString &type, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL)
 Creates a new DAG node with the given type tag. More...
 
MObject create (const MString &type, const MString &name, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL)
 Creates a new DAG node with the given type tag. More...
 
unsigned int parentCount (MStatus *ReturnStatus=NULL) const
 Determines the number of parent Nodes of the Node. More...
 
MObject parent (unsigned int i, MStatus *ReturnStatus=NULL) const
 Queries the DAG Node attached to the Function Set for the parent Node corresponding to the given index. More...
 
MStatus addChild (MObject &child, unsigned int index=kNextPos, bool keepExistingParents=false)
 Makes the given DAG Node a child of the DAG Node to which this instance of the Function Set is attached. More...
 
MStatus removeChild (MObject &child)
 Removes the given DAG Node from the parent. More...
 
MStatus removeChildAt (unsigned int index)
 Removes the child at the given index from the parent. More...
 
unsigned int childCount (MStatus *ReturnStatus=NULL) const
 Determines the number of child Nodes of the Node. More...
 
MObject child (unsigned int i, MStatus *ReturnStatus=NULL) const
 Queries the DAG Node attached to the Function Set for the child Node corresponding to the given index. More...
 
MObject dagRoot (MStatus *ReturnStatus=NULL)
 Determines the root of the first DAG Path to the DAG Node attached to the Function Set. More...
 
bool hasParent (const MObject &node, MStatus *ReturnStatus=NULL) const
 Determines whether or not the given Node is a parent of the DAG Node attached to the Function Set. More...
 
bool hasChild (const MObject &node, MStatus *ReturnStatus=NULL) const
 Determines whether or not the given Node is a child of the DAG Node attached to the Function Set. More...
 
bool isChildOf (const MObject &node, MStatus *ReturnStatus=NULL) const
 Determines whether or not the DAG Node attached to the Function Set is a child of the given node. More...
 
bool isParentOf (const MObject &node, MStatus *ReturnStatus=NULL) const
 Determines whether or not the DAG Node attached to the Function Set is a parent of the given node. More...
 
bool inUnderWorld (MStatus *ReturnStatus=NULL) const
 Determines whether or not the DAG Node is an underworld node. More...
 
bool inModel (MStatus *ReturnStatus=NULL) const
 Determines whether or not the DAG Node is in the model. More...
 
bool isInstanceable (MStatus *ReturnStatus=NULL) const
 Returns true if the DAG node can be instanced, and false otherwise. More...
 
MStatus setInstanceable (const bool how)
 Sets whether or not the DAG node is instanceable. More...
 
bool isInstanced (bool indirect=true, MStatus *ReturnStatus=NULL) const
 Determines whether the DAG Node attached to the Function Set is directly or indirectly instanced. More...
 
bool isInstancedAttribute (const MObject &attr, MStatus *ReturnStatus=NULL) const
 Returns true if the specified attribute is instanced. More...
 
unsigned int instanceCount (bool total, MStatus *ReturnStatus=NULL) const
 Determines the number of times the Node attached to the Function Set is instanced. More...
 
MObject duplicate (bool instance=false, bool instanceLeaf=false, MStatus *ReturnStatus=NULL) const
 This method duplicates the DAG hierarchy rooted at the current node. More...
 
MStatus getPath (MDagPath &path) const
 Returns a DAG Path to the DAG Node attached to the Function Set. More...
 
MStatus getAllPaths (MDagPathArray &paths) const
 Determines all DAG Paths to the DAG Node attached to the Function Set. More...
 
MString fullPathName (MStatus *ReturnStatus=NULL) const
 Return a string representing the full path from the root of the dag to this object. More...
 
MString partialPathName (MStatus *ReturnStatus=NULL) const
 Return a string representing the partial path from the root of the dag to this object. More...
 
MMatrix transformationMatrix (MStatus *ReturnStatus=NULL) const
 Returns the object space transformation matrix for this DAG node. More...
 
bool isIntermediateObject (MStatus *ReturnStatus=NULL) const
 Returns true if this object is an intermediate in a geometry calculation. More...
 
MStatus setIntermediateObject (bool isIntermediate)
 Sets whether this object is an intermediate in a geometry calculation. More...
 
int objectColor (MStatus *ReturnStatus=NULL) const
 This method is obsolete. More...
 
MStatus setObjectColor (int color)
 Sets the index for the current user defined inactive color used by the node. More...
 
bool usingObjectColor (MStatus *ReturnStatus=NULL) const
 
MStatus setUseObjectColor (bool useObjectColor)
 This method is obsolete. More...
 
MObjectColorType objectColorType (MStatus *ReturnStatus=NULL) const
 Determines whether or not the user defined inactive color will be used for the node, or whether the default inactive color will be used. More...
 
MStatus setObjectColorType (MObjectColorType type)
 Sets whether or not the user defined inactive object color will be used. More...
 
MStatus setObjectColor (const MColor &color)
 Sets the color value for the current user defined inactive color used by the node. More...
 
MColor objectColorRGB (MStatus *ReturnStatus=NULL) const
 Determines the RGB color for the current user defined inactive color used by the node. More...
 
int objectColorIndex (MStatus *ReturnStatus=NULL) const
 Determines the index for the current user defined inactive color used by the node. More...
 
MColor hiliteColor (MStatus *ReturnStatus=NULL) const
 Determines the current hilite color used by the node. More...
 
bool usingHiliteColor (MStatus *ReturnStatus=NULL) const
 Determines whether or not the hilite color will be used for the node. More...
 
MColor dormantColor (MStatus *ReturnStatus=NULL) const
 Determines the dormant color used by this node. More...
 
MColor activeColor (MStatus *ReturnStatus=NULL) const
 Determines the active color used by this node. More...
 
bool drawOverrideEnabled (MStatus *ReturnStatus=NULL) const
 Determines whether or not draw override is turned on for this node. More...
 
bool drawOverrideIsReference (MStatus *ReturnStatus=NULL) const
 Determines whether or not Display Type of the draw override is Reference for this node. More...
 
bool drawOverrideIsTemplate (MStatus *ReturnStatus=NULL) const
 Determines whether or not Display Type of the draw override is Template for this node. More...
 
bool drawOverrideColor (MColor &color, MStatus *ReturnStatus=NULL) const
 Determines the draw override color used by this node. More...
 
MStatus getConnectedSetsAndMembers (unsigned int instanceNumber, MObjectArray &sets, MObjectArray &comps, bool renderableSetsOnly) const
 Returns all the sets connected to the specified instance of this DAG object. More...
 
MBoundingBox boundingBox (MStatus *ReturnStatus=NULL) const
 Returns the bounding box for the dag node in object space. More...
 
MDagPath dagPath (MStatus *ReturnStatus=NULL) const
 Returns the DagPath to which the Function Set is attached. More...
 
virtual MStatus setObject (const MDagPath &path)
 Attaches Function Set to the DAG Node that has the given DAG Path. More...
 
virtual MStatus setObject (MObject &object)
 Attaches Function Set to given DAG Node. More...
 
MObject model (MStatus *ReturnStatus=NULL) const
 This method is obsolete. More...
 
 MFnDagNode (const MObject &object, MStatus *ret=NULL)
 No script support. More...
 
virtual MStatus setObject (const MObject &object)
 No script support. More...
 
- Public Member Functions inherited from MFnDependencyNode
virtual ~MFnDependencyNode ()
 Destructor.
 
 MFnDependencyNode ()
 Default constructor.
 
 MFnDependencyNode (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
MObject create (const MTypeId &typeId, MStatus *ReturnStatus=NULL)
 Creates a new dependency node with the given type tag. More...
 
MObject create (const MTypeId &typeId, const MString &name, MStatus *ReturnStatus=NULL)
 Creates a new dependency node with the given type tag. More...
 
MObject create (const MString &type, MStatus *ReturnStatus=NULL)
 Creates a new dependency node with the given type. More...
 
MObject create (const MString &type, const MString &name, MStatus *ReturnStatus=NULL)
 Creates a new dependency node with the given type. More...
 
MTypeId typeId (MStatus *ReturnStatus=NULL) const
 Returns the type id of this node. More...
 
MString typeName (MStatus *ReturnStatus=NULL) const
 Returns the type name of this node. More...
 
MString name (MStatus *ReturnStatus=NULL) const
 Returns the name of this node. More...
 
MString absoluteName (MStatus *ReturnStatus=NULL) const
 Returns the absolute name of this node. More...
 
MString pluginName (MStatus *ReturnStatus=NULL) const
 Returns the name of the plug-in this MFnDependendencyNode was defined in. More...
 
MString setName (const MString &name, bool createNamespace=false, MStatus *ReturnStatus=NULL)
 Sets the name of this node. More...
 
MUuid uuid (MStatus *ReturnStatus=NULL) const
 Returns the node's UUID. More...
 
void setUuid (const MUuid &uuid, MStatus *ReturnStatus=NULL)
 Sets the node's UUID. More...
 
MStatus getConnections (MPlugArray &array) const
 Get all of the current connections to this node as an array of plugs. More...
 
unsigned int attributeCount (MStatus *ReturnStatus=NULL) const
 Returns the number of attributes that this node has. More...
 
MObject attribute (unsigned int index, MStatus *ReturnStatus=NULL) const
 Finds the attribute of this node at the given index. More...
 
MObject reorderedAttribute (unsigned int index, MStatus *ReturnStatus=NULL) const
 Some nodes, such as the various animCurve nodes, require that their attributes be set in a specific order for proper operation. More...
 
MObject attribute (const MString &attrName, MStatus *ReturnStatus=NULL) const
 Finds the attribute of this node that has the given name. More...
 
MAttrClass attributeClass (const MObject &attr, MStatus *ReturnStatus=NULL) const
 Returns the class (normal, dynamic, extension) of the specified attribute. More...
 
MStatus getAffectedAttributes (const MObject &attr, MObjectArray &affectedAttributes) const
 Returns an array of attributes that are affected by the attribute passed in. More...
 
MStatus getAffectedByAttributes (const MObject &attr, MObjectArray &affectedByAttributes) const
 Returns an array of attributes that affect the attribute passed in, attr. More...
 
MPlug findPlug (const MObject &attr, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const
 Attempt to find a plug for the given attribute. More...
 
MPlug findPlug (const MString &attrName, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const
 Attempt to find a plug for the given attribute. More...
 
MPlug findPlug (const MObject &attr, MStatus *ReturnStatus=NULL) const
 This method is obsolete. More...
 
MPlug findPlug (const MString &attrName, MStatus *ReturnStatus=NULL) const
 This method is obsolete. More...
 
MStatus addAttribute (const MObject &attr)
 Add a new dynamic attibute to this node. More...
 
MStatus removeAttribute (const MObject &attr)
 Remove a dynamic attribute from a node. More...
 
MPxNodeuserNode (MStatus *ReturnStatus=NULL) const
 If the function set's node is a plug-in node, then this method will extract the MPxNode pointer from it. More...
 
bool isFromReferencedFile (MStatus *ReturnStatus=NULL) const
 Indicates whether or not this node came from a referenced file. More...
 
bool isShared (MStatus *ReturnStatus=NULL) const
 Indicates whether or not this node is shared. More...
 
bool isTrackingEdits (MStatus *ReturnStatus=NULL) const
 Returns whether or not edits on the given node are being tracked by the generalized edit system. More...
 
bool hasUniqueName (MStatus *ReturnStatus=NULL) const
 Indicates whether or not this node's name is unique within the scene. More...
 
MString parentNamespace (MStatus *ReturnStatus=NULL) const
 Returns the name of the namespace in which this node resides. More...
 
bool isLocked (MStatus *ReturnStatus=NULL) const
 Indicates whether or not this node is locked. More...
 
MStatus setLocked (bool locked)
 Locks or unlocks this node. More...
 
bool isNewAttribute (const MObject &attr, MStatus *ReturnStatus=NULL) const
 Indicates whether or not the specified attribute was added to this node within the current scene. More...
 
MStatus setFlag (unsigned int flag, bool state)
 Sets the state of the specified flag for the node. More...
 
bool isFlagSet (unsigned int flag, MStatus *ReturnStatus=NULL) const
 Retrieves the current state of the specified flag for a node. More...
 
bool isDefaultNode (MStatus *ReturnStatus=NULL) const
 Returns true if the node is a default node. More...
 
MStatus setDoNotWrite (bool flag)
 Use this method to mark the "do not write" state of this node. More...
 
bool canBeWritten (MStatus *ReturnStatus=NULL) const
 Returns the do not write state of the node. More...
 
bool hasAttribute (const MString &name, MStatus *ReturnStatus=NULL) const
 Returns true if the node already has an attribute with the given name. More...
 
MObject getAliasAttr (bool force, MStatus *ReturnStatus=NULL)
 Returns the node's alias attribute, which is a special attribute used to store information about the node's attribute aliases. More...
 
bool setAlias (const MString &alias, const MString &name, const MPlug &plug, bool add=true, MStatus *ReturnStatus=NULL)
 Sets or removes an alias (i.e. More...
 
bool findAlias (const MString &alias, MObject &attrObj, MStatus *ReturnStatus=NULL) const
 Retrieves the attribute with the given alias. More...
 
bool getAliasList (MStringArray &strArray, MStatus *ReturnStatus=NULL)
 Returns a list of all attribute aliases for this node. More...
 
MString plugsAlias (const MPlug &plug, MStatus *ReturnStatus=NULL)
 Returns the alias for the plug's attribute or the empty string if that attribute has no alias. More...
 
MStatus setIcon (const MString &filename)
 Associates a custom icon with the node for display in the Maya UI. More...
 
MString icon (MStatus *ReturnStatus=NULL) const
 Returns the custom icon filename associated with the node. More...
 
MStatus getExternalContent (MExternalContentInfoTable &table) const
 Returns the external content (files) that this node depends on. More...
 
MStatus addExternalContentForFileAttr (MExternalContentInfoTable &table, const MObject &attr) const
 Adds content info to the specified table from a file path attribute. More...
 
MStatus setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &table)
 Sets content info in the specified attribute from the table. More...
 
MStatus setExternalContent (const MExternalContentLocationTable &table)
 Changes the location of external content. More...
 
bool affectsAnimation (MStatus *ReturnStatus=NULL) const
 Indicates whether or not this node is allowed to animate. More...
 
MStatus setAffectsAnimation ()
 Define a node can affect animation. More...
 
MString setName (const MString &name, MStatus *ReturnStatus)
 NO SCRIPT SUPPORT. More...
 
 MFnDependencyNode (const MObject &object, MStatus *ReturnStatus=NULL)
 NO SCRIPT SUPPORT. More...
 
bool getPlugsAlias (const MPlug &plug, MString &aliasName, MStatus *ReturnStatus=NULL)
 NO SCRIPT SUPPORT. More...
 
virtual const adsk::Data::Associationsmetadata (MStatus *ReturnStatus=NULL) const
 This method is not available in Python. More...
 
virtual MStatus setMetadata (const adsk::Data::Associations &)
 This method is not available in Python. More...
 
virtual MStatus deleteMetadata ()
 This method is not available in Python. More...
 
virtual MStatus validateMetadata (MString &errors) const
 This method is not available in Python. More...
 
MStatus dgTimerOn ()
 Indicates that this node should collect DG timing data whenever DG timing is enabled. More...
 
MStatus dgTimerOff ()
 Indicates that this node should no longer collect DG timing data when DG timing is enabled. More...
 
MdgTimerState dgTimerQueryState (MStatus *ReturnStatus=NULL)
 The function returns the current on/off state of the node's timer. More...
 
MStatus dgTimerReset ()
 The function resets the dependency graph timers and counters for this node to zero. More...
 
double dgTimer (const MdgTimerMetric timerMetric, const MdgTimerType timerType, MStatus *ReturnStatus=NULL) const
 The function returns the specified timer value for the current node. More...
 
MStatus dgCallbacks (const MdgTimerType type, MStringArray &callbackName, MDoubleArray &value)
 Node callbacks that occur when timing is enabled get logged with the node and can be queried via this method. More...
 
MStatus dgCallbackIds (const MdgTimerType type, const MString &callbackName, MCallbackIdArray &callbackId, MDoubleArray &value)
 This method provides a further breakdown of the per-callback time returned via dgCallbacks() by returning the data on a per-callbackId basis. More...
 
MStatus addAttribute (const MObject &attr, MAttrClass type)
 This method is obsolete. More...
 
MStatus removeAttribute (const MObject &attr, MAttrClass type)
 This method is obsolete. More...
 
- Public Member Functions inherited from MFnBase
virtual ~MFnBase ()
 Class Destructor. More...
 
bool hasObj (MFn::Type) const
 Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More...
 
bool hasObj (const MObject &) const
 Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More...
 
MObject object (MStatus *ReturnStatus=NULL) const
 Returns the MObject that is attached to the Function Set. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MFnDagNode
static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MFnDependencyNode
static const char * className ()
 Returns the name of this class. More...
 
static MString classification (const MString &nodeTypeName)
 Retrieves the classification string for a node type. More...
 
static unsigned int allocateFlag (const MString pluginName, MStatus *ReturnStatus=NULL)
 Allocates a node flag for sole use by the caller. More...
 
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
 Deallocates a node flag which was previously allocated by a call to allocateFlag. More...
 
static MStatus deallocateAllFlags (const MString pluginName)
 Deallocates all of the node flags which are currently allocated to the specified plugin. More...
 
static void enableDGTiming (bool enable)
 Globally enables or disables the DG node timing mechanism. More...
 
- Static Public Member Functions inherited from MFnBase
static const char * className ()
 Returns the name of this class. More...
 
static const char * typeString (MFn::Type)
 Returns the type string for a given type. More...
 
static bool isValid (MFn::Type)
 Returns true if type is in the range of valid types. More...
 

Detailed Description

Member Enumeration Documentation

enum FilmFit

Specifies how to fit the digital image to the film back.

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.

Enumerator
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.

kInvalid 

 

enum RollOrder

Order in which film back rotation and its transformation by the pivot point are applied.

Enumerator
kRotateTranslate 

Rotate the film back before translating it by the pivot point.

kTranslateRotate 

Translate the film back by the pivot point before rotating it.

Constructor & Destructor Documentation

~MFnCamera ( )
virtual

Destructor.

Class destructor.

MFnCamera ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
  • MS::kSuccess if the function set is successfully attached
  • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject
MFnCamera ( const MDagPath object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters
[in]objectThe const MDagPath to attach the function set to
[out]ReturnStatusThe return status
Status Codes:
  • MS::kSuccess if the function set is successfully attached
  • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject
MFnCamera ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
  • MS::kSuccess if the function set is successfully attached
  • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

Member Function Documentation

MFn::Type type ( ) const
virtual

Function set type.

Return the class type : MFn::kCamera.

Returns
the class type.

Reimplemented from MFnDagNode.

static const char* className ( )
static

Returns the name of this class.

Returns
Name of this class.
MObject create ( MStatus ReturnStatus = NULL)

Creates a perspective camera and a transform to parent it.

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.

Parameters
[out]ReturnStatusStatus code
Returns
The transform parenting the new camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure An object error has occurred
MObject create ( MObject parent,
MStatus ReturnStatus = NULL 
)

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.

Parameters
[in]parentThe parent of the new camera
[out]ReturnStatusStatus code
Returns
The transform parenting the new camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure An object error has occurred
MPoint eyePoint ( MSpace::Space  space = MSpace::kObject,
MStatus ReturnStatus = NULL 
) const

Returns the eye point for the camera.

Parameters
[in]spaceSpecifies the coordinate system for this operation
[out]ReturnStatusStatus code
Returns
The eye point location for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MVector viewDirection ( MSpace::Space  space = MSpace::kObject,
MStatus ReturnStatus = NULL 
) const

Returns the view direction for the camera.

Parameters
[in]spaceSpecifies the coordinate system for this operation
[out]ReturnStatusStatus code
Returns
The view direction vector for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MVector upDirection ( MSpace::Space  space = MSpace::kObject,
MStatus ReturnStatus = NULL 
) const

Returns the up direction vector for the camera.

Parameters
[in]spaceSpecifies the coordinate system for this operation
[out]ReturnStatusStatus code
Returns
The up direction vector for this camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MVector rightDirection ( MSpace::Space  space = MSpace::kObject,
MStatus ReturnStatus = NULL 
) const

Returns the right direction vector for the camera.

Parameters
[in]spaceSpecifies the coordinate system for this operation
[out]ReturnStatusStatus code
Returns
The right direction vector for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MPoint centerOfInterestPoint ( MSpace::Space  space = MSpace::kObject,
MStatus ReturnStatus = NULL 
) const

Returns the center of interest point for the camera.

Parameters
[in]spaceSpecifies the coordinate system for this operation
[out]ReturnStatusStatus code
Returns
The center of interest location of the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus set ( const MPoint wsEyeLocation,
const MVector wsViewDirection,
const MVector wsUpDirection,
double  horizFieldOfView,
double  aspectRatio 
)

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.

Parameters
[in]wsEyeLocationEye location to set in world space
[in]wsViewDirectionView direction to set in world space
[in]wsUpDirectionUp direction to set in world space
[in]horizFieldOfViewThe horizontal field of view to set
[in]aspectRatioThe aspect ratio to set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setEyePoint ( const MPoint eyeLocation,
MSpace::Space  space = MSpace::kObject 
)

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.

Parameters
[in]eyeLocationThe eye location to set
[in]spaceSpecifies the coordinate system for this operation
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
MStatus setCenterOfInterestPoint ( const MPoint centerOfInterest,
MSpace::Space  space = MSpace::kObject 
)

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.

Parameters
[in]centerOfInterestCenter of interest point to be set
[in]spaceSpecifies the coordinate system for this operation
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kInvalidParameter Cannot do world space transform.
  • MS::kFailure An object error has occurred
bool hasSamePerspective ( const MDagPath otherCamera,
MStatus ReturnStatus = NULL 
)

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.

Parameters
[in]otherCameraCamera to compare perspective with
[out]ReturnStatusStatus code
Returns
True if the specified camera has same perspective as this camera, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus copyViewFrom ( const MDagPath otherCamera)

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.

Parameters
[in]otherCameraCamera to copy view from
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getFilmFrustum ( double  distance,
MPointArray  clipPlanes,
bool  applyPanZoom = false 
) const

This method is not available in Python.

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
Parameters
[in]distanceSpecifies the focal length
[out]clipPlanespoint array to store the clip planes
[in]applyPanZoomspecifies whether to apply 2D pan/zoom
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getFilmFrustum ( double  distance,
double &  hSize,
double &  vSize,
double &  hOffset,
double &  vOffset,
bool  applyPanZoom = false 
) const

Returns the film frustum for the camera.

The frustum defines the projective transformation.

Parameters
[in]distanceSpecifies the focal length
[out]hSizestorage for horizontal size
[out]vSizestorage for vertical size
[out]hOffsetstorage for horizontal offset
[out]vOffsetstorage for vertical offset
[in]applyPanZoomspecifies whether to apply 2D pan/zoom
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getPortFieldOfView ( int  width,
int  height,
double &  horizontalFOV,
double &  verticalFOV 
) const

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

Parameters
[in]widthwidth of viewport
[in]heightheight of viewport
[out]horizontalFOVstorage for the horizonal field of view
[out]verticalFOVstorage for the vertical field of view
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getViewParameters ( double  windowAspect,
double &  apertureX,
double &  apertureY,
double &  offsetX,
double &  offsetY,
bool  applyOverscan = false,
bool  applySqueeze = false,
bool  applyPanZoom = false 
) const

Computes and returns the intermediate viewing frustum parameters for the camera.

The aperture and offset are used by getViewingFrustrum() and getRenderingFrustrum() to compute the extent (left, right, top, bottom) of the frustrum 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.

Parameters
[in]windowAspectwindowAspect
[out]apertureXstorage for the horizontal aperture
[out]apertureYstorage for the vertical aperture
[out]offsetXstorage for the horizontal offset
[out]offsetYstorage for the vertical offset
[in]applyOverscanspecifies whether to apply overscan
[in]applySqueezespecifies whether to apply the lens squeeze ratio of the camera
[in]applyPanZoomspecifies whether to apply 2D pan/zoom
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getViewingFrustum ( double  windowAspect,
double &  left,
double &  right,
double &  bottom,
double &  top,
bool  applyOverscan = false,
bool  applySqueeze = false,
bool  applyPanZoom = false 
) const

Computes and returns the viewing frustum for the camera.

Parameters
[in]windowAspectwindowAspect
[out]leftstorage for the left side of frustum
[out]rightstorage for the right side of frustum
[out]bottomstorage for the bottom of frustum
[out]topstorage for the top of frustum
[in]applyOverscanspecifies whether to apply overscan
[in]applySqueezespecifies whether to apply the lens squeeze ratio of the camera
[in]applyPanZoomspecifies whether to apply 2D pan/zoom
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus getRenderingFrustum ( double  windowAspect,
double &  left,
double &  right,
double &  bottom,
double &  top 
) const

Computes and returns the rendering frustum for the camera.

This is the frustum that the maya renderer uses.

Parameters
[in]windowAspectwindowAspect
[out]leftstorage for the left side of frustum
[out]rightstorage for the right side of frustum
[out]bottomstorage for the bottom of frustum
[out]topstorage for the top of frustum
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFloatMatrix projectionMatrix ( MStatus ReturnStatus = NULL) const

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.

Parameters
[out]ReturnStatusStatus code
Returns
The projection matrix
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus setHorizontalFilmAperture ( double  hFilmAperture)

Change the horizontal size of the camera aperture.

Unit used is inches.

Parameters
[in]hFilmApertureHorizontal file aperture value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
double horizontalFilmAperture ( MStatus ReturnStatus = NULL) const

Returns the horizontal film aperture for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal film aperture for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setVerticalFilmAperture ( double  vFilmAperture)

Change the vertical size of the camera aperture.

Unit used is inches.

Parameters
[in]vFilmApertureThe vertical film aperture for the camera
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
double verticalFilmAperture ( MStatus ReturnStatus = NULL) const

Returns the vertical film aperture for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The vertical film aperture for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus getFilmApertureLimits ( double &  min,
double &  max 
) const

Returns the maximum and minimum film aperture limits for the camera.

Parameters
[out]minStorage for the minimum film aperture limit
[out]maxStorage for the maximum film aperture limit
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setAspectRatio ( double  aspectRatio)

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.

Parameters
[in]aspectRatioThe aspect ratio to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double aspectRatio ( MStatus ReturnStatus = NULL) const

Returns the aspect ratio for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The aspect ratio
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus getAspectRatioLimits ( double &  min,
double &  max 
) const

Returns the minimum and maximum aspect ratio limits for the camera.

Parameters
[out]minStorage for the minimum aspect ratio limit
[out]maxStorage for the maximum aspect ratio limit
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalLock ( bool  lockFlag)

Sets the vertical lock to on or off for the camera.

Parameters
[in]lockFlagVertical lock value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isVerticalLock ( MStatus ReturnStatus = NULL) const

Determines if vertical lock is turned on for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
True if the vertical lock is on, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double horizontalFilmOffset ( MStatus ReturnStatus = NULL) const

Returns the horizontal offset of the film.

Unit used is inches.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal film offset for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setHorizontalFilmOffset ( double  hOffset)

Change the horizontal offset of the film.

Unit used is inches.

Parameters
[in]hOffsetThe horizontal film offset value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double verticalFilmOffset ( MStatus ReturnStatus = NULL) const

Change the vertical offset of the film.

Unit used is inches.

Parameters
[out]ReturnStatusStatus code
Returns
The vertical film offset for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalFilmOffset ( double  vOffset)

Change the vertical offset of the film.

Unit used is inches.

Parameters
[in]vOffsetThe vertical film offset value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool shakeEnabled ( MStatus ReturnStatus = NULL) const

Returns the toggle value for the camera shake enabled attribute.

If this attribute is false, the horizontalShake and verticalShake values are ignored by the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal film-based camera shake toggle value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setShakeEnabled ( bool  enabled)

Changes the toggle value for the camera shake enabled attribute.

If this attribute is false, the horizontalShake and verticalShake values are ignored by the camera.

Parameters
[in]enabledThe film-based camera shake toggle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double horizontalShake ( MStatus ReturnStatus = NULL) const

Returns the horizontal offset of the film due to the shake attribute.

Unit used is inches. This horizontal/vertical attribute pair acts identically to the film offset pair, but gives another point of input to that system. This allows film-based camera shake to be accessed conveniently and independently without disturbing any other film-offsetting techniques.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal film-based camera shake offset for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setHorizontalShake ( double  hOffset)

Change the horizontal film-based camera shake value.

Unit used is inches.

Parameters
[in]hOffsetThe horizontal film-based camera shake value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double verticalShake ( MStatus ReturnStatus = NULL) const

Change the vertical film-based camera shake value.

Unit used is inches. This horizontal/vertical attribute pair acts identically to the film offset pair, but gives another point of input to that system. This allows film-based camera shake to be accessed conveniently and independently without disturbing any other film-offsetting techniques.

Parameters
[out]ReturnStatusStatus code
Returns
The vertical film-based camera shake value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalShake ( double  vOffset)

Changes the vertical film-based camera shake value.

Unit used is inches.

Parameters
[in]vOffsetThe vertical film-based camera shake value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool shakeOverscanEnabled ( MStatus ReturnStatus = NULL) const

Returns the toggle value for the camera shake overscan attribute.

If this attribute is false, the shakeOverscan value is ignored by the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The camera shake overscan toggle value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setShakeOverscanEnabled ( bool  enabled)

Changes the toggle value for the camera shake overscan enabled attribute.

If this attribute is false, the shakeOverscan value is ignored by the camera.

Parameters
[in]enabledThe film-based camera shake overscan toggle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double shakeOverscan ( MStatus ReturnStatus = NULL) const

Returns the camera shake overscan value.

Unit is a multiplier to the film aperture. This overscan is used to render a larger area than would be necessary if the camera were not shaking. This attribute will affect the output render.

Parameters
[out]ReturnStatusStatus code
Returns
The film-based camera shake overscan value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setShakeOverscan ( double  overscan)

Changes the camera shake overscan value.

Unit is a multiplier to the film aperture size. This attribute will affect the output render.

Parameters
[in]overscanThe camera shake overscan value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool panZoomEnabled ( MStatus ReturnStatus = NULL) const

Return 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.

Parameters
[out]ReturnStatusStatus code
Returns
The camera 2D pan/zoom toggle value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setPanZoomEnabled ( bool  enabled)

Changes the toggle value for the camera 2D pan/zoom enabled attribute.

Parameters
[in]enabledThe camera 2D pan/zoom enabled toggle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool renderPanZoom ( MStatus ReturnStatus = NULL) const

Return 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.

Parameters
[out]ReturnStatusStatus code
Returns
The camera render 2D pan/zoom toggle value
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setRenderPanZoom ( bool  render)

Changes the toggle value for the camera render 2D pan/zoom enabled attribute.

Parameters
[in]renderThe camera render 2D pan/zoom toggle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double horizontalPan ( MStatus ReturnStatus = NULL) const

Return the camera 2D horizontal pan value.

Unit is inches.

Parameters
[out]ReturnStatusStatus code
Returns
The camera 2D horizontal pan value
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setHorizontalPan ( double  hPan)

Changes the camera 2D horizontal pan value.

Unit is inches.

Parameters
[in]hPanThe camera 2D horizontal pan value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double verticalPan ( MStatus ReturnStatus = NULL) const

Return the camera 2D vertical pan value.

Unit is inches.

Parameters
[out]ReturnStatusStatus code
Returns
The camera 2D vertical pan value
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalPan ( double  vPan)

Changes the camera 2D vertical pan value.

Unit is inches.

Parameters
[in]vPanThe camera 2D vertical pan value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double zoom ( MStatus ReturnStatus = NULL) const

Return the camera 2D zoom value, which is the percent over the film viewable frustum to display.

Parameters
[out]ReturnStatusStatus code
Returns
The camera 2D zoom value
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setZoom ( double  zoom)

Changes the camera 2D zoom value.

Parameters
[in]zoomThe camera 2D zoom value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool stereoHITEnabled ( MStatus ReturnStatus = NULL) const

Returns the toggle value for the stereo HIT enabled attribute.

If this attribute is false, the stereoHIT value is ignored by the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The camera stereo HIT toggle value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setStereoHITEnabled ( bool  enabled)

Changes the toggle value for the stereo HIT enabled attribute.

If this attribute is false, the stereoHIT value is ignored by the camera.

Parameters
[in]enabledThe film-based camera stereo HIT toggle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double stereoHIT ( MStatus ReturnStatus = NULL) const

Returns the camera stereo horizontal image translation (stereo HIT) value.

Unit is inches. This has the same effect as the HFO attribute, but is intended as an input hook for use with stereo camera rigs.

Parameters
[out]ReturnStatusStatus code
Returns
The stereo HIT value for this camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setStereoHIT ( double  hit)

Changes the camera stereo horizontal image translation (stereo HIT) value.

Unit is inches. This has the same effect as the HFO attribute, but is intended as an input hook for use with stereo camera rigs.

Parameters
[in]hitThe stereo HIT value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFilmFit ( FilmFit  filmFit)

Sets how the digital image is to be fitted to the film back.

Parameters
[in]filmFitThe type of film fit
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFnCamera::FilmFit filmFit ( MStatus ReturnStatus = NULL) const

Returns how the digital image is being fitted to the film back.

Parameters
[out]ReturnStatusStatus code
Returns
The type of film fit.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setFilmFitOffset ( double  filmFitOffset)

Set the film fit offset for the camera.

Since 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).

Parameters
[in]filmFitOffset
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double filmFitOffset ( MStatus ReturnStatus = NULL) const

Returns the film fit offset for the camera.

Since 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).

Parameters
[out]ReturnStatusStatus code
Returns
The film fit offset as double.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setOverscan ( double  overscan)

Set the percent of overscan for this camera.

Parameters
[in]overscan
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double overscan ( MStatus ReturnStatus = NULL) const

Returns the percent of overscan for this camera.

Parameters
[out]ReturnStatusStatus code
Returns
The percent of overscan
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setHorizontalRollPivot ( double  horizontalRollPivot)

Set the horizontal roll pivot for film back roll.

Parameters
[in]horizontalRollPivotSpecifies the horizontal pivot value.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double horizontalRollPivot ( MStatus ReturnStatus = NULL) const

Returns the current horizontal roll pivot value.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal roll pivot value.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalRollPivot ( double  verticalRollPivot)

Set the vertical roll pivot for film back roll.

Parameters
[in]verticalRollPivotSpecifies the vertical pivot value.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double verticalRollPivot ( MStatus ReturnStatus = NULL) const

Returns the vertical roll pivot's value.

Parameters
[out]ReturnStatusStatus code
Returns
Vertical roll pivot
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFilmRollValue ( double  filmRollValue)

Set the film roll value for film back.

Parameters
[in]filmRollValueSpecifies the amount rotation in the film back. The film back rotation value is specified in radians.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double filmRollValue ( MStatus ReturnStatus = NULL) const

Returns the current roll value in radians.

Parameters
[out]ReturnStatusStatus code
Returns
Roll value in radians.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFilmRollOrder ( RollOrder  filmRollOrder)

Assign the order in which the film back rotation is applied with respect to the pivot point.

There are 2 choices.

  • 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.
Parameters
[in]filmRollOrderThe order to apply the film roll.
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFnCamera::RollOrder filmRollOrder ( MStatus ReturnStatus = NULL) const

Returns the current roll order.

Parameters
[out]ReturnStatusStatus code
Returns
The roll order
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setPreScale ( double  sf)

Set the pre scale value.

Parameters
[in]sfThe scaling factor.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double preScale ( MStatus ReturnStatus = NULL) const

Return the post projection matrix's pre-scale value.

Parameters
[out]ReturnStatusStatus code.
Returns
Pre scale value.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setPostScale ( double  sf)

Set the post scale value.

Parameters
[in]sfThe scaling factor.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double postScale ( MStatus ReturnStatus = NULL) const

Return the post projection matrix's post-scale value.

Parameters
[out]ReturnStatusStatus code.
Returns
Post scale value.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFilmTranslateH ( double  translate)

Set the horizontal film translate.

Parameters
[in]translateThe amount of translation normalized to the viewing area.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double filmTranslateH ( MStatus ReturnStatus = NULL) const

Returns the horizontal film translate value.

This value corresponds to the normalized viewport.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal translation amount.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFilmTranslateV ( double  translate)

Set the vertical film translate.

Parameters
[in]translateThe amount of translation normalized to the viewing area.
Returns
Status Code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double filmTranslateV ( MStatus ReturnStatus = NULL) const

Returns the vertical film translate value.

This value corresponds to the normalized viewport, [-1,1].

Parameters
[out]ReturnStatusStatus code
Returns
The vertical film translation.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFloatMatrix postProjectionMatrix ( MStatus ReturnStatus = NULL) const

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

Parameters
[out]ReturnStatusStatus code
Returns
The film roll matrix.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setDisplayGateMask ( bool  displayGateMask)

Activate shaded display of the film or resolution gate mask when looking through the camera.

Does not activate the film or resolution gate display.

Parameters
[in]displayGateMaskSpecifies whether to display the film gate shaded.
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isDisplayGateMask ( MStatus ReturnStatus = NULL) const

Determines if the film gate is displayed shaded.

Parameters
[out]ReturnStatusStatus code
Returns
True if the film gate is shaded, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setDisplayFilmGate ( bool  displayFilmGate)

Activate display of the film gate icons when looking through the camera.

Parameters
[in]displayFilmGateSpecifies whether to display the film gate.
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isDisplayFilmGate ( MStatus ReturnStatus = NULL) const

Determines if the film gate icons are displayed when looking through the camera.

Parameters
[out]ReturnStatusStatus code
Returns
True if the film gate is displayed, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setHorizontalFieldOfView ( double  fov)

Sets the horizontal field of view for the camera.

Parameters
[in]fovThe horizontal field of view value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double horizontalFieldOfView ( MStatus ReturnStatus = NULL) const

Returns the horizontal field of view for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The horizontal field of view for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setVerticalFieldOfView ( double  fov)

Sets the vertical field of view for the camera.

Parameters
[in]fovThe vertical field of view value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double verticalFieldOfView ( MStatus ReturnStatus = NULL) const

Returns the vertical field of view for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The vertical field of view for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFocalLength ( double  focalLength)

Sets 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. This double precision parameter is always specified in millimeters.

Parameters
[in]focalLengthThe focal length value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double focalLength ( MStatus ReturnStatus = NULL) const

Returns 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. This double precision parameter is always specified in millimeters.

Parameters
[out]ReturnStatusStatus code
Returns
The focal length for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp, and MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus getFocalLengthLimits ( double &  min,
double &  max 
) const

Returns the focal length limits for the camera.

Parameters
[out]minStorage for the minimum focal length limit
[out]maxStorage for the maximum focal length limit
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setLensSqueezeRatio ( double  aspectRatio)

Set the squeeze ratio of the lens.

The aspect ratio is expressed as width/height.

Parameters
[in]aspectRatioThe lens squeeze ratio to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double lensSqueezeRatio ( MStatus ReturnStatus = NULL) const

Returns the lens squeeze ratio for the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The lens squeeze ratio for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setClippingPlanes ( bool  ClippingPlanes)

Turn on/off manual setting of clip planes.

Parameters
[in]ClippingPlanes
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isClippingPlanes ( MStatus ReturnStatus = NULL) const

Determines whether manual clipping planes are activated.

Parameters
[out]ReturnStatusStatus code
Returns
True if the manual clipping planes are activated, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setNearClippingPlane ( double  dNear)

Set the distances to the Near Clipping Plane.

Parameters
[in]dNearThe near clipping plane value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double nearClippingPlane ( MStatus ReturnStatus = NULL) const

Returns the distance to the near clipping plane.

Parameters
[out]ReturnStatusStatus code
Returns
The near clipping plane value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp, and rawfootPrintNode/rawfootPrintNode.cpp.
MStatus setFarClippingPlane ( double  dFar)

Set the distances to the Far Clipping Plane.

Parameters
[in]dFarThe far clipping plane value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double farClippingPlane ( MStatus ReturnStatus = NULL) const

Returns the distance to the far clipping plane.

Parameters
[out]ReturnStatusStatus code
Returns
The far clipping plane value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setNearFarClippingPlanes ( double  dNear,
double  dFar 
)

Set the distances to the Near and Far Clipping Planes.

Parameters
[in]dNearThe near clipping plane value to be set
[in]dFarThe far clipping plane value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setDepthOfField ( bool  depthOfField)

Specifies whether the depth of field calculation is performed for the camera.

The depth of field calculation is used to give varying focus depending on the distance of the objects.

Parameters
[in]depthOfFieldThe depth of field value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isDepthOfField ( MStatus ReturnStatus = NULL) const

Determines whether the depth of field calculation is performed for the camera.

The depth of field calculation is used to give varying focus depending on the distance of the objects.

Parameters
[out]ReturnStatusStatus code
Returns
True if the depth of field is on, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setFStop ( double  fStop)

Sets the f-stop value for the camera.

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.

Parameters
[in]fStopThe F/Stop value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double fStop ( MStatus ReturnStatus = NULL) const

Returns the f-stop value for the camera.

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.

Parameters
[out]ReturnStatusStatus code
Returns
The F/Stop value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus setFocusDistance ( double  distance)

Set the focus at a certain distance in front of the camera.

Parameters
[in]distanceThe focus distance to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double focusDistance ( MStatus ReturnStatus = NULL) const

Returns the focus distance for the camera.

This value sets the focus at a certain distance in front of the camera.

Parameters
[out]ReturnStatusStatus code
Returns
The focus distance for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus setNearFocusDistance ( double  nearFocusDistance)

Set the nearest distance within the well-focus region.

Parameters
[in]nearFocusDistanceThe near focus distance value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double nearFocusDistance ( MStatus ReturnStatus = NULL) const

Returns the linear distance to the near focus plane.

Parameters
[out]ReturnStatusStatus code
Returns
The near focus distance for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus setFarFocusDistance ( double  farFocusDistance)

Set the farthest distance within the well-focus region.

Parameters
[in]farFocusDistanceThe far focus distance value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double farFocusDistance ( MStatus ReturnStatus = NULL) const

Returns the linear distance to the far focus plane.

Parameters
[out]ReturnStatusStatus code
Returns
The far focus distance for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
animInfoCmd/animInfoCmd.cpp.
MStatus computeDepthOfField ( )
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus computeDepthOfField ( double  nearLimit)
Parameters
[in]nearLimit
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setMotionBlur ( bool  motionBlur)

Turns motion blur on/off for the camera.

Motion blur determines whether the camera's image is motion blurred (as opposed to an object's image). For example, if you want to blur the camera movement when you are performing a fly-by.

Parameters
[in]motionBlurtrue turns motion blur on, false turns it off.
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isMotionBlur ( MStatus ReturnStatus = NULL) const

Determine if motion blur is on/off for the camera.

Motion blur determines whether the camera's image is motion blurred (as opposed to an object's image). For example, if you want to blur the camera movement when you are performing a fly-by.

Parameters
[out]ReturnStatusStatus code
Returns
True if the motion blur is on, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setShutterAngle ( double  shutterAngle)

Change the current shutter angle which is one of the variables used to compute motion blur.

The shutterAngle is specified in radians.

Valid shutter angles must be in the range 1.0 (degrees) to 359.0 (degrees), and must be given in radians. Note: PI radians = 180 degrees.

Parameters
[in]shutterAngleThe shutter angle value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double shutterAngle ( MStatus ReturnStatus = NULL) const

Return the current shutter angle which is one of the variables used to compute motion blur.

The shutter angle is specified in radians.

Parameters
[out]ReturnStatusStatus code
Returns
The shutter angle for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setCenterOfInterest ( double  dist)

Set the Center of Interest, which is defined to be a positive distance along the View Direction (i.e., "in front" of the Camera).

Parameters
[in]distcenter of interest distance value
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double centerOfInterest ( MStatus ReturnStatus = NULL) const

Return the linear distance from the camera's eye point to the center of interest.

Parameters
[out]ReturnStatusStatus code
Returns
center of interest distance value
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setIsOrtho ( bool  orthoState)

Switch the camera in and out of orthographic mode.

This does not change the preset fov or the ortho width, presuming that these values are going to be set at the same time separately.

Parameters
[in]orthoStateIf true then the camera will be orthographic
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setIsOrtho ( bool  orthoState,
double  useDist 
)

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.

Parameters
[in]orthoStateIf true then the camera will be orthographic
[in]useDist
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool isOrtho ( MStatus ReturnStatus = NULL) const

Determines if the camera is in orthographic mode.

Parameters
[out]ReturnStatusStatus code
Returns
True if the camera is orthographic, false otherwise.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
Examples:
MayaPluginForSpreticle/spReticleLoc.cpp.
MStatus setOrthoWidth ( double  orthoWidth)

Sets a new width for the ortho camera.

Bad values are ignored.

Parameters
[in]orthoWidthThe ortho width value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double orthoWidth ( MStatus ReturnStatus = NULL) const

Returns the orthographic projection width.

Parameters
[out]ReturnStatusStatus code
Returns
The orthographic width
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setCameraScale ( double  scale)

Sets the camera scale.

Parameters
[in]scaleThe camera scale value to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double cameraScale ( MStatus ReturnStatus = NULL) const

Returns the camera scale.

Parameters
[out]ReturnStatusStatus code
Returns
The scale value of the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setTumblePivot ( const MPoint point)

The tumble pivot is used for non-local tumble operations.

It is in world space for "tumble pivot" mode and relative space for "local axis" mode (see setUsePivotAsLocalSpace).

Note that when camera is told to look at an object and the camera's usePivotAsLocalSpace() is false, the tumble pivot value for the camera is reset to the centre of the bounding box for the object being looked at.

Parameters
[in]pointThe tumble pivot location to be set
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MPoint tumblePivot ( MStatus ReturnStatus = NULL) const

Returns 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.

Parameters
[out]ReturnStatusStatus code
Returns
The tumble pivot location of the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double unnormalizedNearClippingPlane ( MStatus ReturnStatus = NULL) const

Returns the distance to the near clipping plane.

When a camera set is used to draw in the viewport the minimum near distance of all camera members may be computed. This is the "normalized" value which is returned by the nearClippingPlane() method. The unnormalized value can be queried by this method.

Parameters
[out]ReturnStatusStatus code
Returns
The near clipping plane value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
double unnormalizedFarClippingPlane ( MStatus ReturnStatus = NULL) const

Returns the distance to the far clipping plane.

When a camera set is used to draw in the viewport the maximum far distance of all camera members may be computed. This is the "normalized" value which is returned by the farClippingPlane() method. The unnormalized value can be queried by this method.

Parameters
[out]ReturnStatusStatus code
Returns
The far clipping plane value for the camera
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setStereo ( bool  stereo)

no script support

This method is obsolete. This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Parameters
[in]stereoUnused.
Returns
MS::kSuccess
bool isStereo ( MStatus ReturnStatus = NULL) const

no script support

This method is obsolete. This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Parameters
[out]ReturnStatusStatus code. Will be set to MS::kSuccess.
Returns
false
MStatus setParallelView ( bool  parallelView)

obsolete & no script support

This method is obsolete. This method is not available in Python.

This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.

Parameters
[in]parallelViewUnused.
Status Codes:
MS::kSuccess
bool isParallelView ( MStatus ReturnStatus = NULL) const

no script support

This method is obsolete. This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Parameters
[out]ReturnStatusStatus code. Will be set to MS::kSuccess.
Returns
false
MStatus setEyeOffset ( double  eyeOffset)

no script support

This method is obsolete. This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Parameters
[in]eyeOffsetUnused.
Returns
MS::kSuccess
double eyeOffset ( MStatus ReturnStatus = NULL) const

no script support

This method is obsolete. This method is not available in Python.

This method is obsolete. [From Maya 2019]

Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Deprecated:
This is an obsolete method, only kept for backward compatibility reasons. It does not do anything.
Parameters
[out]ReturnStatusStatus code. Will be set to MS::kSuccess.
Returns
0.0
MStatus getFilmFrustum ( double  distance,
MPoint  clipPlane[4],
bool  applyPanZoom = false 
) const

No script support.

Returns the film frustum for the camera.

The frustum defines the projective transformation.

  • clipPlane[0] is the bottom left
  • clipPlane[1] is the top left
  • clipPlane[2] is the top right
  • clipPlane[3] is the bottom right
Parameters
[in]distanceSpecifies the focal length
[out]clipPlaneStorage for the film frustum (allocated by user)
[in]applyPanZoomspecifies whether to apply 2D pan/zoom
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MStatus setUsePivotAsLocalSpace ( const bool  how)

Local space tumbling specifies that when the camera is tumbled, the camera will rotate about its local axis, offset by the tumblePivot.

The effect is like that of tilting the camera on a tripod. This per-camera setting overrides whatever tumble mode is defined globally in Maya.

For an example of local space tumbling, if `how' is true and this camera's tumblePivot value is (0,1,0) then when tumbled the camera will rotate about a point one unit in Y away from the camera's local axis.

Parameters
[in]howTrue to use local space tumbling for this camera, or false to use the current global tumble setting in Maya (the global tumble setting can be set via the Tumble Tool Option Box). The default value is false.
Returns
Status code
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
bool usePivotAsLocalSpace ( MStatus ReturnStatus = NULL) const

Returns the value of the local axis tumble setting for this camera.

Parameters
[out]ReturnStatusStatus code
Returns
True if using local space tumbling for this camera, or false if using the current global tumble setting in Maya. See setUsePivotAsLocalSpace() for more details.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFloatMatrix postProjectionMatrix ( const MDGContext context,
MStatus ReturnStatus = NULL 
) const

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

This version evaluates in a context other than the current evaluation context, e.g. a different time. Use only when appropriate.

Parameters
[in]contextDG time-context to specify time of evaluation
[out]ReturnStatusStatus code
Returns
The film roll matrix.
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred
MFloatMatrix projectionMatrix ( const MDGContext context,
MStatus ReturnStatus = NULL 
) const

Returns the orthographic or perspective projection matrix for the camera.

This version evaluates in a context other than the current evaluation context, e.g. a different time. Use only when appropriate.

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.

Parameters
[in]contextDG time-context to specify time of evaluation.
[out]ReturnStatusStatus code
Returns
The projection matrix
Status Codes:
  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

The documentation for this class was generated from the following files: