class MFnCamera

Jump to documentation

: public MFnDagNode Function set for cameras. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnCamera < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnCamera ( const MObject & object, MStatus * ReturnStatus = NULL )
MObject create ( MStatus * ReturnStatus = NULL )
MObject create ( MObject & parent, MStatus * ReturnStatus = NULL )
MPoint eyePoint ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MVector viewDirection ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MVector upDirection ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MVector rightDirection ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MPoint centerOfInterestPoint ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MStatus set ( const MPoint & wsEyeLocation, const MVector & wsViewDirection, const MVector & wsUpDirection, double horizFieldOfView, double aspectRatio )
MStatus setEyePoint ( const MPoint &eyeLocation, MSpace::Space space = MSpace::kObject )
MStatus setCenterOfInterestPoint ( const MPoint & centerOfInterest , MSpace::Space space = MSpace::kObject )
bool hasSamePerspective ( const MDagPath &otherCamera, MStatus * ReturnStatus = NULL )
MStatus copyViewFrom ( const MDagPath &otherCamera )
MStatus getFilmFrustum ( double distance, MPointArray clipPlanes ) const
MStatus getFilmFrustum ( double distance, double& hSize, double& vSize, double& hOffset, double& vOffset ) const
MStatus getPortFieldOfView ( int width, int height, double& horizontalFOV, double& verticalFOV ) const
MStatus getViewingFrustum ( double windowAspect, double& left, double& right, double& bottom, double& top, bool applyOverscan = false, bool applySqueeze = false ) const
MStatus getRenderingFrustum ( double windowAspect, double& left, double& right, double& bottom, double& top ) const
MFloatMatrix projectionMatrix ( MStatus * ReturnStatus = NULL ) const
MFloatMatrix projectionMatrix ( MDGContext & context, MStatus * ReturnStatus = NULL ) const
MStatus setHorizontalFilmAperture ( double hFilmAperture )
double horizontalFilmAperture ( MStatus * ReturnStatus = NULL ) const
MStatus setVerticalFilmAperture ( double vFilmAperture )
double verticalFilmAperture ( MStatus * ReturnStatus = NULL ) const
MStatus getFilmApertureLimits ( double & min, double & max ) const
MStatus setAspectRatio ( double aspectRatio )
double aspectRatio ( MStatus * ReturnStatus = NULL ) const
MStatus getAspectRatioLimits (double & min, double & max) const
MStatus setVerticalLock ( bool lockFlag )
bool isVerticalLock ( MStatus * ReturnStatus = NULL ) const
double horizontalFilmOffset ( MStatus * ReturnStatus = NULL ) const
MStatus setHorizontalFilmOffset ( double hOffset )
double verticalFilmOffset ( MStatus * ReturnStatus = NULL ) const
MStatus setVerticalFilmOffset ( double vOffset )
bool shakeEnabled ( MStatus * ReturnStatus = NULL) const
MStatus setShakeEnabled ( bool enabled )
double horizontalShake ( MStatus * ReturnStatus = NULL ) const
MStatus setHorizontalShake ( double hOffset )
double verticalShake ( MStatus * ReturnStatus = NULL ) const
MStatus setVerticalShake ( double vOffset )
bool shakeOverscanEnabled ( MStatus * ReturnStatus = NULL) const
MStatus setShakeOverscanEnabled ( bool enabled )
double shakeOverscan ( MStatus * ReturnStatus = NULL ) const
MStatus setShakeOverscan ( double vOffset )
bool stereoHITEnabled ( MStatus * ReturnStatus = NULL) const
MStatus setStereoHITEnabled ( bool enabled )
double stereoHIT ( MStatus * ReturnStatus = NULL ) const
MStatus setStereoHIT ( double vOffset )
enum FilmFit
kFillFilmFit
kHorizontalFilmFit
kVerticalFilmFit
kOverscanFilmFit
kInvalid
MStatus setFilmFit ( FilmFit filmFit )
FilmFit filmFit ( MStatus * ReturnStatus = NULL ) const
MStatus setFilmFitOffset ( double filmFitOffset )
double filmFitOffset ( MStatus * ReturnStatus = NULL ) const
MStatus setOverscan ( double overscan )
double overscan ( MStatus * ReturnStatus = NULL ) const
MStatus setHorizontalRollPivot ( double horizontalRollPivot )
double horizontalRollPivot ( MStatus * ReturnStatus = NULL ) const
MStatus setVerticalRollPivot ( double verticalRollPivot )
double verticalRollPivot ( MStatus * ReturnStatus = NULL ) const
MStatus setFilmRollValue ( double filmRollValue )
double filmRollValue ( MStatus * ReturnStatus = NULL ) const
enum RollOrder
kRotateTranslate
kTranslateRotate
MStatus setFilmRollOrder ( RollOrder filmRollOrder )
RollOrder filmRollOrder ( MStatus * ReturnStatus = NULL ) const
MStatus setPreScale ( double sf )
double preScale ( MStatus * ReturnStatus = NULL ) const
MStatus setPostScale ( double sf )
double postScale ( MStatus * ReturnStatus = NULL ) const
MStatus setFilmTranslateH ( double translate )
double filmTranslateH ( MStatus * ReturnStatus = NULL ) const
MStatus setFilmTranslateV ( double translate )
double filmTranslateV ( MStatus * ReturnStatus = NULL ) const
MFloatMatrix postProjectionMatrix ( MStatus * ReturnStatus = NULL ) const
MFloatMatrix postProjectionMatrix ( MDGContext & context, MStatus * ReturnStatus = NULL ) const
MStatus setDisplayFilmGate ( bool displayFilmGate )
bool isDisplayFilmGate ( MStatus * ReturnStatus = NULL ) const
MStatus setHorizontalFieldOfView ( double fov )
double horizontalFieldOfView ( MStatus * ReturnStatus = NULL ) const
MStatus setVerticalFieldOfView ( double fov )
double verticalFieldOfView ( MStatus * ReturnStatus = NULL ) const
MStatus setFocalLength ( double focalLength )
double focalLength ( MStatus * ReturnStatus = NULL ) const
MStatus getFocalLengthLimits ( double & min, double & max ) const
MStatus setLensSqueezeRatio ( double lensSqueezeRatio )
double lensSqueezeRatio ( MStatus * ReturnStatus = NULL ) const
MStatus setClippingPlanes ( bool ClippingPlanes )
bool isClippingPlanes ( MStatus * ReturnStatus = NULL ) const
MStatus setNearClippingPlane ( double dNear )
double nearClippingPlane ( MStatus * ReturnStatus = NULL ) const
MStatus setFarClippingPlane ( double dFar )
double farClippingPlane ( MStatus * ReturnStatus = NULL ) const
MStatus setNearFarClippingPlanes ( double dNear, double dFar )
MStatus setDepthOfField ( bool depthOfField )
bool isDepthOfField ( MStatus * ReturnStatus = NULL ) const
MStatus setFStop ( double fStop )
double fStop ( MStatus * ReturnStatus = NULL ) const
MStatus setFocusDistance ( double distance )
double focusDistance ( MStatus * ReturnStatus = NULL ) const
MStatus setNearFocusDistance ( double nearFocusDistance )
double nearFocusDistance ( MStatus * ReturnStatus = NULL ) const
MStatus setFarFocusDistance ( double farFocusDistance )
double farFocusDistance ( MStatus * ReturnStatus = NULL ) const
MStatus computeDepthOfField ()
MStatus computeDepthOfField ( double nearLimit )
MStatus setMotionBlur ( bool motionBlur )
bool isMotionBlur ( MStatus * ReturnStatus = NULL ) const
MStatus setShutterAngle ( double shutterAngle )
double shutterAngle ( MStatus * ReturnStatus = NULL ) const
MStatus setCenterOfInterest ( double dist )
double centerOfInterest ( MStatus * ReturnStatus = NULL ) const
MStatus setIsOrtho ( bool orthoState )
MStatus setIsOrtho ( bool orthoState, double useDist )
bool isOrtho ( MStatus * ReturnStatus = NULL ) const
MStatus setOrthoWidth ( double orthoWidth )
double orthoWidth ( MStatus * ReturnStatus = NULL ) const
MStatus setCameraScale ( double scale )
double cameraScale ( MStatus * ReturnStatus = NULL ) const
MStatus setTumblePivot ( const MPoint & point )
MPoint tumblePivot ( MStatus * ReturnStatus = NULL ) const
MStatus setStereo ( bool stereo )
OBSOLETE & NO SCRIPT SUPPORT
bool isStereo ( MStatus * ReturnStatus = NULL ) const
OBSOLETE & NO SCRIPT SUPPORT
MStatus setParallelView ( bool parallelView )
OBSOLETE & NO SCRIPT SUPPORT
bool isParallelView ( MStatus * ReturnStatus = NULL ) const
OBSOLETE & NO SCRIPT SUPPORT
MStatus setEyeOffset ( double eyeOffset )
OBSOLETE & NO SCRIPT SUPPORT
double eyeOffset ( MStatus * ReturnStatus = NULL ) const
OBSOLETE & NO SCRIPT SUPPORT
MStatus getFilmFrustum ( double distance, MPoint clipPlane[4] ) const
NO SCRIPT SUPPORT
MStatus setUsePivotAsLocalSpace ( const bool how )
bool usePivotAsLocalSpace ( MStatus * ReturnStatus = NULL ) const

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Description

Function set for creation, edit, and query of cameras.

Many of the camera settings only affect the resulting rendered image. E.g. the F/Stop, shutter speed, the film related options, etc.

Functions

MFnCamera:: MFnCamera ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnCamera:: MFnCamera ( MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnCamera ( const MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnCamera ( const MDagPath & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • 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

MFn::Type MFnCamera:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kCamera

MFnCamera:: ~MFnCamera ()

Description

Class destructor.

MObject MFnCamera:: create ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: create ( MObject & parent, MStatus * ReturnStatus )

Description

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.

Arguments

  • parent The parent of the new camera
  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: eyePoint ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the eye point for the camera.

Arguments

  • space Specifies the coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • 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

MVector MFnCamera:: viewDirection ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the view direction for the camera.

Arguments

  • space Specifies the coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • 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

MVector MFnCamera:: upDirection ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the up direction vector for the camera.

Arguments

  • space Specifies the coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • 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

MVector MFnCamera:: rightDirection ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the right direction vector for the camera.

Arguments

  • space Specifies the coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • 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

MPoint MFnCamera:: centerOfInterestPoint ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the center of interest point for the camera.

Arguments

  • space Specifies the coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • 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

MStatus MFnCamera:: set ( const MPoint & wsEyeLocation, const MVector & wsViewDirection, const MVector & wsUpDirection, double horizFieldOfView, double aspectRatio )

Description

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.

Arguments

  • wsEyeLocation Eye location to set in world space
  • wsViewDirection View direction to set in world space
  • wsUpDirection Up direction to set in world space
  • horizFieldOfView The horizontal field of view to set
  • aspectRatio The aspect ratio to set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setEyePoint ( const MPoint &eyeLocation, MSpace::Space space )

Description

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.

Arguments

  • eyeLocation The eye location to set
  • space Specifies the coordinate system for this operation

Return Value

  • 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 MFnCamera:: setCenterOfInterestPoint ( const MPoint & centerOfInterest , MSpace::Space space )

Description

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.

Arguments

  • centerOfInterest Center of interest point to be set
  • space Specifies the coordinate system for this operation

Return Value

  • 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 MFnCamera:: hasSamePerspective ( const MDagPath &otherCamera, MStatus * ReturnStatus )

Description

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.

Arguments

  • otherCamera Camera to compare perspective with
  • ReturnStatus Status code

Return Value

  • true Specified camera has same perspective as this camera
  • false Specified camera has different perspective to this camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: copyViewFrom ( const MDagPath &otherCamera )

Description

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.

Arguments

  • otherCamera Camera to copy view from

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getFilmFrustum ( double distance, MPointArray clipPlanes ) const

Description

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

Arguments

  • distance Specifies the focal length
  • clipPlanes point array to store the clip planes

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getFilmFrustum ( double distance, MPoint clipPlane[4] ) const

Description

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

Arguments

  • distance Specifies the focal length
  • clipPlane Storage for the film frustum (allocated by user)

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getFilmFrustum ( double distance, double& hSize, double& vSize, double& hOffset, double& vOffset ) const

Description

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

Arguments

  • distance Specifies the focal length
  • hSize storage for horizontal size
  • vSize storage for vertical size
  • hOffset storage for horizontal offset
  • vOffset storage for vertical offset

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getPortFieldOfView ( int width, int height, double& horizontalFOV, double& verticalFOV ) const

Description

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

Arguments

  • width width of viewport
  • height height of viewport
  • horizontalFOV storage for the horizonal field of view
  • verticalFOV storage for the vertical field of view
  • ReturnStatus status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getViewingFrustum ( double windowAspect, double& left, double& right, double& bottom, double& top, bool applyOverscan , bool applySqueeze ) const

Description

Computes and returns the viewing frustum for the camera.

Arguments

  • windowAspect windowAspect
  • left storage for the left side of frustum
  • right storage for the right side of frustum
  • bottom storage for the bottom of frustum
  • top storage for the top of frustum
  • applyOverscan specifies whether to apply overscan
  • applySqueeze specifies whether to apply the lens squeeze ratio of the camera

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getRenderingFrustum ( double windowAspect, double& left, double& right, double& bottom, double& top ) const

Description

Computes and returns the rendering frustum for the camera. This is the frustum that the maya renderer uses.

Arguments

  • windowAspect windowAspect
  • left storage for the left side of frustum
  • right storage for the right side of frustum
  • bottom storage for the bottom of frustum
  • top storage for the top of frustum

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFloatMatrix MFnCamera:: projectionMatrix ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • The projection matrix

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFloatMatrix MFnCamera:: projectionMatrix ( MDGContext & context, MStatus * ReturnStatus ) const

Description

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.

Arguments

  • context DG time-context to specify time of evaluation.
  • ReturnStatus Status code

Return Value

  • The projection matrix

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setHorizontalFilmAperture ( double hFilmAperture )

Description

Change the horizontal size of the camera aperture. Unit used is inches.

Arguments

  • hFilmAperture Horizontal file aperture value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: horizontalFilmAperture ( MStatus * ReturnStatus ) const

Description

Returns the horizontal film aperture for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The horizontal film aperture for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setVerticalFilmAperture ( double vFilmAperture )

Description

Change the vertical size of the camera aperture. Unit used is inches.

Arguments

  • The vertical film aperture for the camera

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: verticalFilmAperture ( MStatus * ReturnStatus ) const

Description

Returns the vertical film aperture for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The vertical film aperture for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getFilmApertureLimits ( double & min, double & max ) const

Description

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

Arguments

  • min Storage for the minimum film aperture limit
  • max Storage for the maximum film aperture limit

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setAspectRatio ( double aspectRatio )

Description

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.

Arguments

  • aspectRatio The aspect ratio to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: aspectRatio ( MStatus * ReturnStatus ) const

Description

Returns the aspect ratio for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The aspect ratio

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getAspectRatioLimits (double & min, double & max) const

Description

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

Arguments

  • min Storage for the minimum aspect ratio limit
  • max Storage for the maximum aspect ratio limit

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setVerticalLock ( bool lockFlag )

Description

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

Arguments

  • lockFlag Vertical lock value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isVerticalLock ( MStatus * ReturnStatus ) const

Description

Determines if vertical lock is turned on for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • true Vertical lock is on
  • false Vertical lock is off

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: horizontalFilmOffset ( MStatus * ReturnStatus ) const

Description

Returns the horizontal offset of the film. Unit used is inches.

Arguments

  • ReturnStatus Status code

Return Value

  • The horizontal film offset for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setHorizontalFilmOffset ( double hOffset )

Description

Change the horizontal offset of the film. Unit used is inches.

Arguments

  • hOffset The horizontal film offset value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: verticalFilmOffset ( MStatus * ReturnStatus ) const

Description

Change the vertical offset of the film. Unit used is inches.

Arguments

  • ReturnStatus Status code

Return Value

  • The vertical film offset for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setVerticalFilmOffset ( double vOffset)

Description

Change the vertical offset of the film. Unit used is inches.

Arguments

  • vOffset The vertical film offset value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: shakeEnabled ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setShakeEnabled ( bool enabled )

Description

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.

Arguments

  • enabled The film-based camera shake toggle value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: horizontalShake ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setHorizontalShake ( double hOffset )

Description

Change the horizontal film-based camera shake value. Unit used is inches.

Arguments

  • hOffset The horizontal film-based camera shake value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: verticalShake ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setVerticalShake ( double vOffset)

Description

Changes the vertical film-based camera shake value. Unit used is inches.

Arguments

  • vOffset The vertical film-based camera shake value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: shakeOverscanEnabled ( MStatus * ReturnStatus ) const

Description

Returns the toggle value for the camera shake overscan attribute. If this attribute is false, the shakeOverscan value is ignored by the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setShakeOverscanEnabled ( bool enabled )

Description

Changes the toggle value for the camera shake overscan enabled attribute. If this attribute is false, the shakeOverscan value is ignored by the camera.

Arguments

  • enabled The film-based camera shake overscan toggle value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: shakeOverscan ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setShakeOverscan ( double overscan )

Description

Changes the camera shake overscan value. Unit is a multiplier to the film aperture size. This attribute will affect the output render.

Arguments

  • vOffset The camera shake overscan value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: stereoHITEnabled ( MStatus * ReturnStatus ) const

Description

Returns the toggle value for the stereo HIT enabled attribute. If this attribute is false, the stereoHIT value is ignored by the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MFnCamera:: setStereoHITEnabled ( bool enabled )

Description

Changes the toggle value for the stereo HIT enabled attribute. If this attribute is false, the stereoHIT value is ignored by the camera.

Arguments

  • enabled The film-based camera stereo HIT toggle value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: stereoHIT ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • The stereo HIT value for this camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setStereoHIT ( double hit)

Description

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.

Arguments

  • vOffset The stereo HIT value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmFit ( FilmFit filmFit )

Description

This describes how the digital image (in pixels) relates to the film back. Since the film back is defined in terms of real numbers with some arbitrary film aspect, and the digital image is defined in integer pixels with an equally arbitrary (and different) resolution, relating the two can get complicated.

There are 4 choices:

  • kHorizontalFilmFit In this case the digital image is made to fit the film back exactly in the horizontal direction. This then gives each pixel a horizontal size = (film back width) / (horizontal resolution). The pixel height is then = (pixel width) / (pixel aspect ratio). Now that the pixel has a size, resolution gives us a complete image. That image will match the film back exactly in width. It will almost never match in height, either being too tall or too short. By playing with the numbers you can get it pretty close though.
  • kVerticalFilmFit This is the same idea as horizontal fit, only applied vertically. Thus the digital image will match the film back exactly in height, but miss in width.
  • kFillFilmFit This is a convenience item. The system calculates both horizontal and vertical fits and then applies the one that makes the digital image larger than the film back.
  • 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.

Arguments

  • filmFit The type of film fit

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFnCamera::FilmFit MFnCamera:: filmFit ( MStatus * ReturnStatus ) const

Description

This describes how the digital image (in pixels) relates to the film back. Since the film back is defined in terms of real numbers with some arbitrary film aspect, and the digital image is defined in integer pixels with an equally arbitrary (and different) resolution, relating the two can get complicated.

There are 4 choices:

  • kHorizontalFilmFit In this case the digital image is made to fit the film back exactly in the horizontal direction. This then gives each pixel a horizontal size = (film back width) / (horizontal resolution). The pixel height is then = (pixel width) / (pixel aspect ratio). Now that the pixel has a size, resolution gives us a complete image. That image will match the film back exactly in width. It will almost never match in height, either being too tall or too short. By playing with the numbers you can get it pretty close though.
  • kVerticalFilmFit This is the same idea as horizontal fit, only applied vertically. Thus the digital image will match the film back exactly in height, but miss in width.
  • kFillFilmFit This is a convenience item. The system calculates both horizontal and vertical fits and then applies the one that makes the digital image larger than the film back.
  • 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 This value is returned if any object error occurs.

Arguments

  • ReturnStatus Status code

Return Value

  • The type of film fit.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmFitOffset ( double filmFitOffset )

Description

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

Arguments

  • filmFitOffset

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: filmFitOffset ( MStatus * ReturnStatus ) const

Description

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

  • ReturnStatus Status code

Return Value

  • The film fit offset as double.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setOverscan ( double overscan )

Description

Set the percent of overscan for this camera.

Arguments

  • overscan

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: overscan ( MStatus * ReturnStatus ) const

Description

Returns the percent of overscan for this camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The percent of overscan

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setHorizontalRollPivot ( double horizontalRollPivot )

Description

Set the horizontal roll pivot for film back roll.

Arguments

  • horizontalRollPivot Specifies the horizontal pivot value.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: horizontalRollPivot ( MStatus * ReturnStatus ) const

Description

Returns the current horizontal roll pivot value.

Arguments

  • ReturnStatus Status code

Return Value

  • The horizontal roll pivot value.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setVerticalRollPivot ( double verticalRollPivot )

Description

Set the vertical roll pivot for film back roll.

Arguments

  • verticalRollPivot Specifies the vertical pivot value.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: verticalRollPivot ( MStatus * ReturnStatus ) const

Description

Returns the vertical roll pivot's value.

Arguments

  • ReturnStatus Status code

Return Value

  • Vertical roll pivot

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmRollValue ( double filmRollValue )

Description

Set the film roll value for film back.

Arguments

  • filmRollValue Specifies the amount rotation in the film back. The film back rotation value is specified in radians.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: filmRollValue ( MStatus * ReturnStatus ) const

Description

Returns the current roll value in radians.

Arguments

  • ReturnStatus Status code

Return Value

  • roll value in radians.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmRollOrder ( RollOrder filmRollOrder )

Description

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.

Arguments

  • filmRollOrder The order to apply the film roll.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFnCamera::RollOrder MFnCamera:: filmRollOrder ( MStatus * ReturnStatus ) const

Description

Returns the current roll order

Arguments

  • ReturnStatus Status code

Return Value

  • The roll order

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFloatMatrix MFnCamera:: postProjectionMatrix ( MStatus * ReturnStatus ) const
Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • The film roll matrix.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MFloatMatrix MFnCamera:: postProjectionMatrix ( MDGContext & context, MStatus * ReturnStatus ) const
Description

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

Arguments

  • context DG time-context to specify time of evaluation
  • ReturnStatus Status code

Return Value

  • The film roll matrix.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: preScale ( MStatus * ReturnStatus ) const
Description

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

Arguments

  • ReturnStatus Status code.

Return Value

  • Pre scale value.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: postScale ( MStatus * ReturnStatus ) const
Description

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

Arguments

  • ReturnStatus Status code.

Return Value

  • Post scale value.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: filmTranslateH ( MStatus * ReturnStatus ) const
Description

Returns the horizontal film translate value. This value corresponds to the normalized viewport.

Arguments

  • ReturnStatus Status code

Return Value

  • The horizontal translation amount.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: filmTranslateV ( MStatus * ReturnStatus ) const
Description

Returns the vertical film translate value. This value corresponds to the normalized viewport, [-1,1].

Arguments

  • ReturnStatus Status code

Return Value

  • The vertical film translation.

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setPreScale ( double sf )

Description

Set the pre scale value.

Arguments

  • sf The scaling factor.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setPostScale ( double sf )

Description

Set the post scale value.

Arguments

  • sf The scaling factor.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmTranslateH ( double translate )

Description

Set the horizontal film translate.

Arguments

  • translate The amount of translation normalized to the viewing area.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFilmTranslateV ( double translate )

Description

Set the vertical film translate.

Arguments

  • translate The amount of translation normalized to the viewing area.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setDisplayFilmGate ( bool displayFilmGate )

Description

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

Arguments

  • displayFilmGate Specifies whether to display the film gate.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isDisplayFilmGate ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • true The film gate is displayed
  • false The film gate is not displayed

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setHorizontalFieldOfView ( double fov )

Description

Sets the horizontal field of view for the camera.

Arguments

  • fov The horizontal field of view value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: horizontalFieldOfView ( MStatus * ReturnStatus ) const

Description

Returns the horizontal field of view for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The horizontal field of view for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setVerticalFieldOfView ( double fov )

Description

Sets the vertical field of view for the camera.

Arguments

  • fov The vertical field of view value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: verticalFieldOfView ( MStatus * ReturnStatus ) const

Description

Returns the vertical field of view for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The vertical field of view for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFocalLength ( double focalLength )

Description

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.

Arguments

  • focalLength The focal length value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: focalLength ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • The focal length for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: getFocalLengthLimits ( double & min, double & max) const

Description

Returns the focal length limits for the camera.

Arguments

  • min Storage for the minimum focal length limit
  • max Storage for the maximum focal length limit

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setLensSqueezeRatio ( double aspectRatio )

Description

Set the squeeze ratio of the lens. The aspect ratio is expressed as width/height.

Arguments

  • squeezeRatio The lens squeeze ratio to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: lensSqueezeRatio ( MStatus * ReturnStatus ) const

Description

Returns the lens squeeze ratio for the camera.

Arguments

  • ReturnStatus Status code

Return Value

  • The lens squeeze ratio for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setClippingPlanes ( bool ClippingPlanes )

Description

Turn on/off manual setting of clip planes.

Arguments

  • ClippingPlanes

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isClippingPlanes ( MStatus * ReturnStatus ) const

Description

Determines whether manual clipping planes are activated.

Arguments

  • ReturnStatus Status code

Return Value

  • true manual clipping planes are activated
  • false manual clipping planes are not activated

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setNearClippingPlane ( double dNear )

Description

Set the distances to the Near Clipping Plane.

Arguments

  • dNear The near clipping plane value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: nearClippingPlane ( MStatus * ReturnStatus ) const

Description

Returns the distance to the near clipping plane.

Arguments

  • ReturnStatus Status code

Return Value

  • The near clipping plane value for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFarClippingPlane ( double dFar )

Description

Set the distances to the Far Clipping Plane.

Arguments

  • dFar The far clipping plane value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: farClippingPlane ( MStatus * ReturnStatus ) const

Description

Returns the distance to the far clipping plane.

Arguments

  • ReturnStatus Status code

Return Value

  • The far clipping plane value for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setNearFarClippingPlanes ( double dNear, double dFar )

Description

Set the distances to the Near and Far Clipping Planes.

Arguments

  • dNear The near clipping plane value to be set
  • dFar The far clipping plane value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setDepthOfField ( bool depthOfField )

Description

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.

Arguments

  • depthOfField The depth of field value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isDepthOfField ( MStatus * ReturnStatus ) const

Description

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

  • ReturnStatus Status code

Return Value

  • true Depth of field is on
  • false Depth of field is off

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFStop ( double fStop )

Description

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.

Arguments

  • fStop The F/Stop value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: fStop ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • The F/Stop value for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFocusDistance ( double distance )

Description

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

Arguments

  • distance The focus distance to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: focusDistance ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • The focus distance for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setNearFocusDistance ( double nearFocusDistance )

Description

Set the nearest distance within the well-focus region

Arguments

  • nearFocusDistance The near focus distance value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: nearFocusDistance ( MStatus * ReturnStatus ) const

Description

Returns the linear distance to the near focus plane.

Arguments

  • ReturnStatus Status code

Return Value

  • The near focus distance for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setFarFocusDistance ( double farFocusDistance )

Description

Set the farthest distance within the well-focus region

Arguments

  • farFocusDistance The far focus distance value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: farFocusDistance ( MStatus * ReturnStatus ) const

Description

Returns the linear distance to the far focus plane.

Arguments

  • ReturnStatus Status code

Return Value

  • The far focus distance for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: computeDepthOfField ()

Description

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: computeDepthOfField ( double nearLimit )

Description

Arguments

  • nearLimit

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setMotionBlur ( bool motionBlur )

Description

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.

Arguments

  • motionBlur true turns motion blur on, false turns it off.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isMotionBlur ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • true Motion blur is on
  • false Motion blur is off

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setShutterAngle ( double shutterAngle )

Description

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.

Arguments

  • shutterAngle The shutter angle value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: shutterAngle ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • The shutter angle for the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setCenterOfInterest ( double dist )

Description

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

Arguments

  • dist center of interest distance value

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: centerOfInterest ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • center of interest distance value

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setIsOrtho ( bool orthoState )

Description

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.

Arguments

  • orthoState If true then the camera will be orthographic

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setIsOrtho ( bool orthoState, double useDist )

Description

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.

Arguments

  • orthoState If true then the camera will be orthographic
  • userDist

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: isOrtho ( MStatus * ReturnStatus ) const

Description

Determines if the camera is in orthographic mode.

Arguments

  • ReturnStatus Status code

Return Value

  • true The camera is orthographic
  • false The camera is perspective

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setOrthoWidth ( double orthoWidth )

Description

Sets a new width for the ortho camera. Bad values are ignored.

Arguments

  • orthoWidth The ortho width value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: orthoWidth ( MStatus * ReturnStatus ) const

Description

Returns the orthographic projection width.

Arguments

  • ReturnStatus Status code

Return Value

  • The orthographic width

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setCameraScale ( double scale )

Description

Sets the camera scale.

Arguments

  • scale The camera scale value to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

double MFnCamera:: cameraScale ( MStatus * ReturnStatus ) const

Description

Returns the camera scale.

Arguments

  • ReturnStatus Status code

Return Value

  • The scale value of the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setStereo ( bool )

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • Bool value. Ignored.

Return Value

  • MS::kSuccess

bool MFnCamera:: isStereo ( MStatus * ReturnStatus ) const

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • ReturnStatus Status code. Will be set to MS::kSuccess.

Return Value

  • false

MStatus MFnCamera:: setParallelView ( bool )

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • Bool value. Ignored.

Status Codes

  • MS::kSuccess

bool MFnCamera:: isParallelView ( MStatus * ReturnStatus ) const

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • ReturnStatus Status code. Will be set to MS::kSuccess.

Return Value

  • false

MStatus MFnCamera:: setEyeOffset ( double )

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • Double value Ignored.

Return Value

  • MS::kSuccess

double MFnCamera:: eyeOffset ( MStatus * ReturnStatus ) const

Description

This is an obsolete method, only kept for bakward compatibility reasons. It will be removed in a future release.

Arguments

  • ReturnStatus Status code. Will be set to MS::kSuccess.

Return Value

  • 0.0

MStatus MFnCamera:: setTumblePivot ( const MPoint & point )

Description

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.

Arguments

  • point The tumble pivot location to be set

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MPoint MFnCamera:: tumblePivot ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • The tumble pivot location of the camera

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

MStatus MFnCamera:: setUsePivotAsLocalSpace ( const bool how )

Description

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.

Arguments

  • how True 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.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful
  • MS::kFailure An object error has occurred

bool MFnCamera:: usePivotAsLocalSpace ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus Status code

Return Value

  • 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

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright