- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MFnData Class Reference
FunctionSet classes | OpenMaya - API module for common classes

This reference page is linked to from the following overview topics: Complex Attributes, Data creators, A more complex example, Communication Between Manipulators and Nodes, polyModifierCmd example.

Search for all occurrences

## Detailed Description

Parent class for dependency graph data function sets.

MFnData is the parent class for all dependency graph data function sets. Conceptually, data objects are what flow through the connections in the dependency graph.

Each node in the dependency graph has a data block associated with it. The data block holds the data objects for all of the node's attributes (see MDataBlock). The data block is only available during the compute method of a node. A data handle (MDataHandle) can be created to access a particular attribute's data inside of the data block.

Once a data handle is obtained, it is possible to get the data object from it. This is only necessary for heavier data structures such as geometry or strings. Simple numeric data can be manipulated straight through the data handle.

Note: using kDynSweptGeometry data requires that a plug-in or stand alone API application be linked with the OpenMayaFX library.

`#include <MFnData.h>`

Inheritance diagram for MFnData:
[legend]

List of all members.

## Public Types
enum | Type { kInvalid, kNumeric, kPlugin, kPluginGeometry, kString, kMatrix, kStringArray, kDoubleArray, kFloatArray, kIntArray, kPointArray, kVectorArray, kComponentList, kMesh, kLattice, kNurbsCurve, kNurbsSurface, kSphere, kDynArrayAttrs, kDynSweptGeometry, kSubdSurface, kNObject, kNId, kAny, kLast }
| Types of dependency graph data. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnData ()
| Destructor.
| MFnData (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnData ()
| Default class constructor.
| MFnData (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum Type

Search for all occurrences

Types of dependency graph data.

Enumerator:

  kInvalid | Invalid value. Search for all occurrences
  kNumeric | Numeric, use MFnNumericData extract the node data. Search for all occurrences
  kPlugin | Plugin Blind Data, use MFnPluginData to extract the node data. Search for all occurrences
  kPluginGeometry | Plugin Geometry, use MFnGeometryData to extract the node data. Search for all occurrences
  kString | String, use MFnStringData to extract the node data. Search for all occurrences
  kMatrix | Matrix, use MFnMatrixData to extract the node data. Search for all occurrences
  kStringArray | String Array, use MFnStringArrayData to extract the node data. Search for all occurrences
  kDoubleArray | Double Array, use MFnDoubleArrayData to extract the node data. Search for all occurrences
  kFloatArray | Float Array, use MFnFloatArrayData to extract the node data. Search for all occurrences
  kIntArray | Int Array, use MFnIntArrayData to extract the node data. Search for all occurrences
  kPointArray | Point Array, use MFnPointArrayData to extract the node data. Search for all occurrences
  kVectorArray | Vector Array, use MFnVectorArrayData to extract the node data. Search for all occurrences
  kComponentList | Component List, use MFnComponentListData to extract the node data. Search for all occurrences
  kMesh | Mesh, use MFnMeshData to extract the node data. Search for all occurrences
  kLattice | Lattice, use MFnLatticeData to extract the node data. Search for all occurrences
  kNurbsCurve | Nurbs Curve, use MFnNurbsCurveData to extract the node data. Search for all occurrences
  kNurbsSurface | Nurbs Surface, use MFnNurbsSurfaceData to extract the node data. Search for all occurrences
  kSphere | Sphere, use MFnSphereData to extract the node data. Search for all occurrences
  kDynArrayAttrs | ArrayAttrs, use MFnArrayAttrsData to extract the node data. Search for all occurrences
  kDynSweptGeometry | SweptGeometry, use MFnDynSweptGeometryData to extract the node data. This data node is in OpenMayaFX which must be linked to. Search for all occurrences
  kSubdSurface | Subdivision Surface, use MFnSubdData to extract the node data. Search for all occurrences
  kNObject | nObject data, use MFnNObjectData to extract node data Search for all occurrences
  kNId | nId data, use MFnNIdData to extract node data Search for all occurrences
  kAny | Typically used when the data can be one of several types. Search for all occurrences
  kLast | Last value. It does not represent real data, but can be used to loop on all possible types Search for all occurrences

Reimplemented in MFnArrayAttrsData, and MFnNumericData.

## Constructor & Destructor Documentation

MFnData | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnData | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const`[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kData.

Reimplemented from MFnBase.

Reimplemented in MFnArrayAttrsData, MFnComponentListData, MFnDoubleArrayData, MFnDynSweptGeometryData, MFnFloatArrayData, MFnGeometryData, MFnIntArrayData, MFnLatticeData, MFnMatrixData, MFnMeshData, MFnNIdData, MFnNObjectData, MFnNumericData, MFnNurbsCurveData, MFnNurbsSurfaceData, MFnPluginData, MFnPointArrayData, MFnSphereData, MFnStringArrayData, MFnStringData, MFnSubdData, MFnUInt64ArrayData, and MFnVectorArrayData.

const char * className | ( |  | ) | const`[protected, virtual]`

Search for all occurrences

Class name.

Return the class name : "MFnData".

Reimplemented in MFnArrayAttrsData, MFnComponentListData, MFnDoubleArrayData, MFnDynSweptGeometryData, MFnFloatArrayData, MFnGeometryData, MFnIntArrayData, MFnLatticeData, MFnMatrixData, MFnMeshData, MFnNIdData, MFnNObjectData, MFnNumericData, MFnNurbsCurveData, MFnNurbsSurfaceData, MFnPluginData, MFnPointArrayData, MFnSphereData, MFnStringArrayData, MFnStringData, MFnSubdData, MFnUInt64ArrayData, and MFnVectorArrayData.

MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData
MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData MFnData