C++ API Reference

Base class for user defined imagePlane nodes. More...

#include <MPxImagePlane.h>

+ Inheritance diagram for MPxImagePlane:

Public Member Functions

 MPxImagePlane ()
 Class constructor.
 
 ~MPxImagePlane () override
 Class destructor.
 
MPxNode::Type type () const override
 Returns the type of node that this is. More...
 
virtual MStatus loadImageMap (const MString &fileName, int frame, MImage &image)
 Override this method to load the file of name fileName into the image MImage. More...
 
bool getExactImageFile (const MString &refFileName, MString &actualName)
 API users can call this method to resolve a file name. More...
 
MString exactImageFile (const MString &refFileName)
 API users can call this method to resolve a file name. More...
 
void refreshImage ()
 Forces the image plane to be refreshed.
 
void setImageDirty ()
 Forces the image plane to be reloaded on the next refresh.
 
- Public Member Functions inherited from MPxNode
 MPxNode ()
 Constructor. More...
 
virtual ~MPxNode ()
 Destructor.
 
virtual void postConstructor ()
 Post constructor. More...
 
virtual MStatus compute (const MPlug &, MDataBlock &)
 This method should be overridden in user defined nodes. More...
 
virtual bool getInternalValue (const MPlug &, MDataHandle &)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual bool setInternalValue (const MPlug &, const MDataHandle &)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual int internalArrayCount (const MPlug &) const
 This method is overridden by nodes that have internal array attributes which are not stored in Maya's datablock. More...
 
virtual void copyInternalData (MPxNode *)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual MStatus legalConnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const
 This method allows you to check for legal connections being made to attributes of this node. More...
 
virtual MStatus legalDisconnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const
 This method allows you to check for legal disconnections being made to attributes of this node. More...
 
virtual MStatus setDependentsDirty (const MPlug &plug, MPlugArray &plugArray)
 This method can be overridden in user defined nodes to specify which plugs should be set dirty based upon an input plug {plugBeingDirtied} which Maya is marking dirty. More...
 
virtual MStatus preEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode)
 Prepare a node's internal state for threaded evaluation. More...
 
virtual MStatus postEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode, PostEvaluationType evalType)
 Clean up node's internal state after threaded evaluation. More...
 
virtual SchedulingType schedulingType () const
 When overridden this method controls the degree of parallelism supported by the node during threaded evaluation. More...
 
virtual void getCacheSetup (const MEvaluationNode &, MNodeCacheDisablingInfo &, MNodeCacheSetupInfo &, MObjectArray &) const
 Provide node-specific setup info for the Cached Playback system. More...
 
virtual void configCache (const MEvaluationNode &, MCacheSchema &) const
 Defines the node's behavior when participating in Cached Playback. More...
 
virtual MTimeRange transformInvalidationRange (const MPlug &source, const MTimeRange &input) const
 Override this method to register this node as an Invalidation-Range-Transformation kernel (IRT kernel) An IRT kernel node will change the invalidation time range for its downstream nodes For example, Dynamics-solver will transform invalidation time range [a,b] to [a,+inf) And Clip-Time-Editor will send out the invalidation range for each of the clip [a,b] to ( [t0+a,t0+b] U [t1+a,t1+b] U [t2+a,t2+b] U ... More...
 
bool hasInvalidationRangeTransformation () const
 Checks if this MPxNode derived node overrides the MPxNode::transformInvalidationRange method.
 
virtual MStatus connectionMade (const MPlug &, const MPlug &, bool asSrc)
 This method gets called when connections are made to attributes of this node. More...
 
virtual MStatus connectionBroken (const MPlug &, const MPlug &, bool asSrc)
 This method gets called when connections are broken with attributes of this node. More...
 
virtual MStatus dependsOn (const MPlug &, const MPlug &, bool &depends) const
 This method may be overridden by the user defined node. More...
 
virtual bool isPassiveOutput (const MPlug &) const
 This method may be overridden by the user defined node if it wants to provide output attributes which do not prevent value modifications to the destination attribute. More...
 
virtual MStatus shouldSave (const MPlug &, bool &isSaving)
 This method may be overridden by the user defined node. More...
 
virtual MPlug passThroughToOne (const MPlug &) const
 This method may be overridden by nodes that have a one-to-one relationship between an input attribute and a corresponding output attribute. More...
 
virtual bool passThroughToMany (const MPlug &, MPlugArray &) const
 This method is overridden by nodes that want to control the traversal behavior of some Maya search algorithms which traverse the history/future of shape nodes looking for directly related nodes. More...
 
virtual bool isAbstractClass () const
 Override this class to return true if this node is an abstract node. More...
 
virtual bool isTrackingTopology () const
 Override this class to return true if this node wants to track topology. More...
 
virtual MStringArray getFilesToArchive (bool shortName=false, bool unresolvedName=false, bool markCouldBeImageSequence=false) const
 Use this method to return all external files used by this node. More...
 
virtual void getExternalContent (MExternalContentInfoTable &table) const
 Returns the external content (files) that this node depends on. More...
 
bool addExternalContentForFileAttr (MExternalContentInfoTable &, const MObject &attr) const
 Adds content info to the specified table from a file path attribute. More...
 
bool setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &)
 Sets content info in the specified attribute from the table. More...
 
virtual void setExternalContent (const MExternalContentLocationTable &)
 Changes the location of external content in batch. More...
 
virtual MTypeId typeId () const
 Returns the TYPEID of this node. More...
 
virtual MString typeName () const
 Returns the type name of this node. More...
 
virtual MString name () const
 Returns the name of this particular instance of this class. More...
 
virtual MObject thisMObject () const
 Returns the MObject associated with this user defined node. More...
 
virtual MStatus setExistWithoutInConnections (bool flag)
 This method specifies whether or not the node can exist without input connections. More...
 
virtual bool existWithoutInConnections (MStatus *ReturnStatus=NULL) const
 Determines whether or not this node can exist without input connections. More...
 
virtual MStatus setExistWithoutOutConnections (bool flag)
 This method specifies whether or not the node can exist without output connections. More...
 
virtual bool existWithoutOutConnections (MStatus *ReturnStatus=NULL) const
 Determines whether or not this node can exist without output connections. More...
 
void _setMPSafe (bool isMPSafe)
 This method is obsolete. More...
 
MDataBlock _forceCache (const MDGContext &)
 This method is obsolete. More...
 
virtual bool getInternalValueInContext (const MPlug &, MDataHandle &, MDGContext &)
 This method is obsolete. More...
 
virtual bool setInternalValueInContext (const MPlug &, const MDataHandle &, MDGContext &)
 This method is obsolete. More...
 
virtual int internalArrayCount (const MPlug &, const MDGContext &) const
 This method is obsolete. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MPxNode
static MStatus addAttribute (const MObject &attr)
 This method adds a new attribute to a user defined node type during the type's initialization. More...
 
static MStatus inheritAttributesFrom (const MString &parentClassName)
 This method allows a class of plugin node to inherit all of the attributes of a second class of plugin node. More...
 
static MStatus attributeAffects (const MObject &whenChanges, const MObject &isAffected)
 This method specifies that a particular input attribute affects a specific output attribute. More...
 
static MStatus attributeAffects (const MObject &whenChanges, const MObject &isAffected, bool affectsTopology)
 This method is an extension to the other version of the attributeAffects method. More...
 
static const char * className ()
 Returns the name of this class. More...
 

Static Public Attributes

static MObject imageType
 controls the source of the image on the Image plane.
 
static MObject imageName
 The file name of the image to be used in the image plane. More...
 
static MObject useFrameExtension
 When this is on, the system will substitute the frame number in the Image Name with the number from the Frame Extension attribute (see below). More...
 
static MObject frameExtension
 The frame extension in Image Name is replaced by the number here.
 
static MObject coverage
 Controls the amount of the image that will be used in the image plane.
 
static MObject coverageX
 The width in pixels of the area on the source image to be used.
 
static MObject coverageY
 The height in pixels of the area on the source image to be used.
 
static MObject coverageOrigin
 Controls the lower-left-corner of the area of the input image that will be used on the image plane. More...
 
static MObject coverageOriginX
 The pixel position of the left edge of the area of the source image to be used.
 
static MObject coverageOriginY
 The pixel position of the bottom edge of the area of the source image to be used.
 
static MObject sourceTexture
 If the Type attribute is set to Texture, then this attribute is connected to the texture node used by the image plane. More...
 
static MObject fit
 Controls how the image file will be fit into the image plane.
 
static MObject displayMode
 Controls how the image plane will be displayed both in the 3d view, and when rendered. More...
 
static MObject displayOnlyIfCurrent
 If enabled, you will only see the image plane when you are looking through the camera that the plane is attached to. More...
 
static MObject colorGain
 A multiplier applied to the colors in the image plane.
 
static MObject colorGainR
 The red component of Color Gain.
 
static MObject colorGainG
 The green component of Color Gain.
 
static MObject colorGainB
 The blue component of Color Gain.
 
static MObject colorOffset
 An additive value applied to the colors in the image plane.
 
static MObject colorOffsetR
 The red component of Color Offset.
 
static MObject colorOffsetG
 The green component of Color Offset.
 
static MObject colorOffsetB
 The blue component of Color Offset.
 
static MObject alphaGain
 A multiplier that is applied to the alpha value.
 
static MObject shadingSamplesOverride
 The flag to control if this surface should override global shading sample settings.
 
static MObject shadingSamples
 Specifies the minimum number of shading samples should be taken for this surface during rendering.
 
static MObject maxShadingSamples
 Specifies the max number of shading samples can be taken for this surface during rendering.
 
static MObject lockedToCamera
 If enabled, the image plane is locked to the camera's position.
 
static MObject depth
 Controls the distance of the plane from the camera.
 
static MObject squeezeCorrection
 Applies a horizontal scaling to an image.
 
static MObject size
 Controls the width and height of the image plane.
 
static MObject sizeX
 Image plane width.
 
static MObject sizeY
 Image plane height.
 
static MObject offset
 Controls how much the center of the image plane is offset from the centre of the viewing frustum of the camera. More...
 
static MObject offsetX
 Horizontal component of Offset.
 
static MObject offsetY
 Vertical component of Offset.
 
static MObject center
 Controls the world-space position of the center of the image plane. More...
 
static MObject centerX
 X component of Center.
 
static MObject centerY
 Y component of Center.
 
static MObject centerZ
 Z component of Center.
 
static MObject width
 Controls the width of the image plane in world space.
 
static MObject height
 Controls the height of the image plane in world space.
 
static MObject visibleInReflections
 When ray tracing, controls whether the image plane will sppear in reflected surfaces. More...
 
static MObject visibleInRefractions
 When ray tracing, controls whether the image plane will appear when seen through a transparent, refractive surface. More...
 
static MObject rotate
 Rotation of the image plane around the view vector.
 
static MObject alreadyPremult
 Indicates if the image plane has already been pre-multiplied by its alpha. More...
 
static MObject useDepthMap
 Indicates that the image plane has depth information.
 
static MObject composite
 Indicates whether or not the image plane's color should be composited into the final image. More...
 
static MObject depthOversample
 Indicates if the depth information is at a higher resolution than the image resolution. More...
 
static MObject separateDepth
 Users can specify a depth buffer that is larger than the image buffer using the 'depthFile' attribute. More...
 
static MObject depthFile
 Separate file that contains depth information.
 
static MObject depthBias
 Depth offset value – centered at the center of the view frustum.
 
static MObject depthScale
 Scale the depth – centered at the center of the view frustum.
 
- Static Public Attributes inherited from MPxNode
static MObject message
 message attribute
 
static MObject isHistoricallyInteresting
 is historically interesting attribute
 
static MObject caching
 caching attribute
 
static MObject state
 state attribute
 
static MObject frozen
 frozen attribute
 

Additional Inherited Members

- Public Types inherited from MPxNode
enum  Type {
  kDependNode, kLocatorNode, kDeformerNode, kManipContainer,
  kSurfaceShape, kFieldNode, kEmitterNode, kSpringNode,
  kIkSolverNode, kHardwareShader, kHwShaderNode, kTransformNode,
  kObjectSet, kFluidEmitterNode, kImagePlaneNode, kParticleAttributeMapperNode,
  kCameraSetNode, kConstraintNode, kManipulatorNode, kMotionPathNode,
  kClientDeviceNode, kThreadedDeviceNode, kAssembly, kSkinCluster,
  kGeometryFilter, kBlendShape, kLast
}
 Defines the type of node. More...
 
enum  SchedulingType {
  kParallel, kSerial, kGloballySerial, kUntrusted ,
  kDefaultScheduling = kSerial, kSerialize = kSerial, kGloballySerialize = kGloballySerial
}
 Defines the degree of parallelism of a node. More...
 
- Protected Member Functions inherited from MPxNode
virtual MDataBlock forceCache ()
 USE _forceCache() IN SCRIPT. More...
 
virtual MStatus setDoNotWrite (bool flag)
 USE _setDoNotWrite() IN SCRIPT. More...
 
virtual bool doNotWrite (MStatus *ReturnStatus=NULL) const
 USE _doNotWrite() IN SCRIPT. More...
 
virtual void setMPSafe (bool isMPSafe)
 This method is obsolete. More...
 
virtual MDataBlock forceCache (const MDGContext &)
 This method is obsolete. More...
 

Detailed Description

Base class for user defined imagePlane nodes.

MPxImagePlane provides you with the ability to write your own image plane classes. This allows you to support non-standard image data in an image plane or change the standard behaviour of the image plane.

Note, once you have created a custom image plane and created the node in a scene. You must attach the image plane to a camera using the 'imagePlane' attribute on the 'cameraShape'.

Examples:
customImagePlane/customImagePlane.cpp.

Member Function Documentation

MPxNode::Type type ( ) const
overridevirtual

Returns the type of node that this is.

This is used to differentiate user defined nodes that are derived off different MPx base classes.

It is not necessary to override this method.

Returns
Type of the node

Reimplemented from MPxNode.

MStatus loadImageMap ( const MString fileName,
int  frame,
MImage image 
)
virtual

Override this method to load the file of name fileName into the image MImage.

Parameters
[in]fileNameThe name of the file to be loaded.
[in]frameThe frame number to be displayed.
[in]imageThe image representing the image plane data.
Returns
MStatus::kSuccess The file was successfully loaded.
Examples:
customImagePlane/customImagePlane.cpp.
bool getExactImageFile ( const MString refFileName,
MString actualName 
)

API users can call this method to resolve a file name.

Sometimes the file path specified by the user node are relative or contain environment variables that require expansion. Also getExactImageFile() will try to find the image file sequence if use sequence is on. API users do not have to call this method, and it is only provided for convienence purposes. The full path name will be returned in actualName.

Python Notes

This method is not supported in Python, see exactImageFile() instead

Parameters
[in]refFileNameThe file name to be expanded
[in]actualNameThe exact file name.
Returns
  • true The file was found and the file name was expanded.
  • false The file was not found and the file name was not expanded.
MString exactImageFile ( const MString refFileName)

API users can call this method to resolve a file name.

Sometimes the file path specified by the user node are relative or contain environment variables that require expansion. Also getExactImageFile() will try to find the image file sequence if use sequence is on. API users do not have to call this method, and it is only provided for convienence purposes. The full path name will be returned in actualName.

Parameters
[in]refFileNameThe file name to be expanded
Returns
String containing the image file name, will be empty string on failure
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.

Member Data Documentation

MObject imageName
static

The file name of the image to be used in the image plane.

Only used if Type is set to Image File.

MObject useFrameExtension
static

When this is on, the system will substitute the frame number in the Image Name with the number from the Frame Extension attribute (see below).

MObject coverageOrigin
static

Controls the lower-left-corner of the area of the input image that will be used on the image plane.

MObject sourceTexture
static

If the Type attribute is set to Texture, then this attribute is connected to the texture node used by the image plane.

MObject displayMode
static

Controls how the image plane will be displayed both in the 3d view, and when rendered.

MObject displayOnlyIfCurrent
static

If enabled, you will only see the image plane when you are looking through the camera that the plane is attached to.

MObject offset
static

Controls how much the center of the image plane is offset from the centre of the viewing frustum of the camera.

MObject center
static

Controls the world-space position of the center of the image plane.

MObject visibleInReflections
static

When ray tracing, controls whether the image plane will sppear in reflected surfaces.

MObject visibleInRefractions
static

When ray tracing, controls whether the image plane will appear when seen through a transparent, refractive surface.

MObject alreadyPremult
static

Indicates if the image plane has already been pre-multiplied by its alpha.

MObject composite
static

Indicates whether or not the image plane's color should be composited into the final image.

MObject depthOversample
static

Indicates if the depth information is at a higher resolution than the image resolution.

MObject separateDepth
static

Users can specify a depth buffer that is larger than the image buffer using the 'depthFile' attribute.


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