class MFnPluginData

Jump to documentation

: public MFnData User defined data function set for dependency node data. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnPluginData < MFnData < MFnBase

public members:

MFnPluginData ()
MFnPluginData ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnPluginData ()
virtual MFn::Type type () const
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MPxData * data ( MStatus * ReturnStatus = NULL )
const MPxData * constData ( MStatus * ReturnStatus = NULL ) const
MObject create ( const MTypeId & id, MStatus * ReturnStatus = NULL )
MFnPluginData ( const MObject & object, MStatus * ReturnStatus = NULL )

Inherited from MFnData:

public members:

enum Type
kInvalid
kNumeric
Numeric, use MFnNumericData extract the node data.
kPlugin
Plugin Blind Data, use MFnPluginData to extract the node data.
kPluginGeometry
Plugin Geometry, use MFnGeometryData to extract the node data.
kString
String, use MFnStringData to extract the node data.
kMatrix
Matrix, use MFnMatrixData to extract the node data.
kStringArray
String Array, use MFnStringArrayData to extract the node data.
kDoubleArray
Double Array, use MFnDoubleArrayData to extract the node data.
kIntArray
Int Array, use MFnIntArrayData to extract the node data.
kPointArray
Point Array, use MFnPointArrayData to extract the node data.
kVectorArray
Vector Array, use MFnVectorArrayData to extract the node data.
kComponentList
Component List, use MFnComponentListData to extract the node data.
kMesh
Mesh, use MFnMeshData to extract the node data.
kLattice
Lattice, use MFnLatticeData to extract the node data.
kNurbsCurve
Nurbs Curve, use MFnNurbsCurveData to extract the node data.
kNurbsSurface
Nurbs Surface, use MFnNurbsSurfaceData to extract the node data.
kSphere
Sphere, use MFnSphereData to extract the node data.
kDynArrayAttrs
ArrayAttrs, use MFnArrayAttrsData to extract the node data.
kDynSweptGeometry
SweptGeometry, use MFnDynSweptGeometryData to extract the node data.
kSubdSurface
Subdivision Surface, use MFnSubdData to extract the node data.
kNObject
nObject data, use MFnNObjectData to extract node data
kLast

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

Create and manipulate user defined dependency node data.
Description

All user defined data that is to be passed between nodes in the dependency graph must be derived from MPxData. The use of this class is closely linked to the use of MPxData, MFnPluginData, MDataHandle, and MTypeId.

In order to use user defined data, one must first create an instance of the MTypeId class that is initialized with a unique id tag. Then create a new class derived from MPxData to hold the user-defined data, As well as a helper class derived from MPxData that can create instances of the new derived type.

For data of this type that needs to be passed into a plug, one would get an MDataHandle for the attribute that uses the type. This would result in a call to the MPxData helper class that would create an instance of the type inside the MDataHandle. The MDataHandle::data method can then be used to get an get an MObject for the user defined data and this should be used to initialize an instance of MFnPluginData. Then the MFnPluginData::data method can be used to get an MPxData pointer, which can be safely cast to a pointer of the user defined type. The data can be updated through this pointer, after which the MDataHandle::setClean method is used to complete the operation.

To receive data of this type from a plug, an MDataHandle for the attribute that uses the new data type is created. The MDataHandle::type method should be used to ascertain that it contains kPlugin data. Then the MDataHandle::data method is used to get an MObject for the user defined data and this should be used to initialize an instance of MFnPluginData. The MFnPluginData::typeId method can be used to ascertain that the data is in fact of the user defined type. Then the MFnPluginData::data method can be used to get an MPxData pointer, which can be safely cast to a pointer to the user defined type.

Functions

MFnPluginData:: MFnPluginData ()

Description

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

MFnPluginData:: MFnPluginData ( 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

MFnPluginData:: MFnPluginData ( 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

MFnPluginData:: ~MFnPluginData ()

Description

The class destructor.

MFn::Type MFnPluginData:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kPluginData

MObject MFnPluginData:: create ( const MTypeId & id, MStatus * ReturnStatus )

Description

Create an instance of MPluginData and initialize it to represent user defined data of the given type.

Arguments

  • id the unique MTypeId of the user defined data class derived from MPxData.
  • ReturnStatus kSuccess if the create suceeds, and kFailure otherwise

Return Value

  • an MObject that represents an instance of the user defined data type. This will be set to MObject::kNullObj if the create failes.

MTypeId MFnPluginData:: typeId ( MStatus * ReturnStatus ) const

Description

Return the unique MTypeId of the user defined data that is held by this instance.

Arguments

  • ReturnStatus kSuccess if the instance is attached to an MObject and kFailure otherwise

Return Value

  • the unique MTypeId of the data held in this instance

MPxData * MFnPluginData:: data ( MStatus * ReturnStatus )

Description

Return a pointer to the user defined data held in this instance.

Arguments

  • ReturnStatus kSuccess if the instance is attached to an MObject and kFailure otherwise

Return Value

  • a pointer to the MPxData base class for the user defined data

const MPxData * MFnPluginData:: constData ( MStatus * ReturnStatus ) const

Description

Return a constant pointer to the user defined data held in this instance.

Arguments

  • ReturnStatus kSuccess if the instance is attached to an MObject and kFailure otherwise

Return Value

  • a constant pointer to the MPxData base class for the user defined data

This class has no child classes.


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