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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

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

Search for all occurrences

## Detailed Description

Component list function set for dependency node data.

MFnComponentListData allows the creation and manipulation of component list (represented as MObjects) data objects for use in the dependency graph.

If a user written dependency node either accepts or produces MObjects containing component lists, then this class is used to extract or create the data that comes from or goes to other dependency graph nodes. To access it, the MDataHandle::data method is used to get an MObject for the data and this should then be used to initialize an instance of MFnComponentListData.

Examples:

  meshOpCmd.cpp, meshOpNode.cpp, splitUVCmd.cpp, and splitUVNode.cpp.

`#include <MFnComponentListData.h>`

Inheritance diagram for MFnComponentListData:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnComponentListData ()
| Destructor.
| MFnComponentListData ()
| Default constructor.
| MFnComponentListData (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
unsigned int | length (MStatus *ReturnStatus=NULL) const
| Return the number of components in the instance.
bool | has (const MObject &obj, MStatus *ReturnStatus=NULL) const
| Determine if the instance of the component list contains the component represented by the given MObject.
MObject | operator[] (unsigned int index) const
| Extract the indicated component from the const instance.
MStatus | add (MObject &)
| Add the given component to the component list.
MStatus | remove (const MObject &)
| Remove the given component from the component list.
MStatus | remove (unsigned int index)
| Remove the indicated component from the component list.
MStatus | clear ()
| Remove all components from the component list.
MObject | create (MStatus *ReturnStatus=NULL)
| Create a new MObject, attach it to this instance, and initialize it to contain an empty component list.
| MFnComponentListData (const MObject &object, MStatus *ReturnStatus=NULL)
| NO SCRIPT SUPPORT.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

MFnComponentListData | ( | 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

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

NO SCRIPT SUPPORT.

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

Constructor

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::kComponentListData.

Reimplemented from MFnData.

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

Search for all occurrences

Class name.

Return the class name : "MFnComponentListData".

Reimplemented from MFnData.

unsigned int length | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Return the number of components in the instance.

Parameters:

  [out] | ReturnStatus | Status code.

Returns:
  The number of components in the instance

Status Codes:
  - MS::kSuccess Operation successful.
  - MS::kFailure The instance is not attached to a component list.

bool has | ( | const MObject & | obj,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Determine if the instance of the component list contains the component represented by the given MObject.

Parameters:

  [in] | obj | the MObject containing the component to look for
  [out] | ReturnStatus | Status code.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

Returns:
  true if the component list contains the component, false otherwise

MObject operator[] | ( | unsigned int | index | ) | const

Extract the indicated component from the const instance.

No checking is done by this class to ensure that the index is valid - use the length method to determine the size of the array. If the instance is not attached to an MObject, this method will return MObject::kNullObj.

Parameters:

  [in] | index | the index of the component to extract

Returns:
  The indicated component

MStatus add | ( | MObject & | obj | ) |

Search for all occurrences

Add the given component to the component list.

Parameters:

  [in] | obj | an MObject containing the component to add

Returns:
  kSuccess if successful, kFailure if either the instance is not attached to a component list, or the given MObject does not contain a component.

Examples:
  meshOpCmd.cpp, and splitUVCmd.cpp.

MStatus remove | ( | const MObject & | obj | ) |

Search for all occurrences

Remove the given component from the component list.

Parameters:

  [in] | obj | an MObject containing the component to remove

Returns:
  kSuccess if successful, kFailure if either the instance is not attached to a component list, or the given MObject does not contain a component.

MStatus remove | ( | unsigned int | index | ) |

Search for all occurrences

Remove the indicated component from the component list.

Parameters:

  [in] | index | the index of the component to remove

Returns:
  kSuccess if successful, kFailure if either the instance is not attached to a component list.

MStatus clear | ( |  | ) |

Search for all occurrences

Remove all components from the component list.

Returns:
  kSuccess if successful, kFailure if either the instance is not attached to a component list.

MObject create | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Create a new MObject, attach it to this instance, and initialize it to contain an empty component list.

Parameters:

  [out] | ReturnStatus | kSuccess

Returns:
  The newly created MObject

Examples:
  meshOpCmd.cpp, and splitUVCmd.cpp.

MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData
MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData MFnComponentListData