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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

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

Search for all occurrences

## Detailed Description

Geometry data function set.

This class is the function set for geometry data.

Geometry data adds matrix and grouping (set) information to regular data and is used to pass geometry types such as mesh, lattice, and NURBS shape data through DG connections.

User defined geometry data types (MPxGeometryData) are also supported by this class.

The matrix within geometry data is the matrix used to convert the object into local space.

`#include <MFnGeometryData.h>`

Inheritance diagram for MFnGeometryData:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnGeometryData ()
| Destructor.
| MFnGeometryData ()
| Default constructor.
| MFnGeometryData (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
MStatus | setMatrix (const MMatrix &)
| Reset the matrix the the specified matrix and set the identity flag if the new matrix is the identity.
MStatus | getMatrix (MMatrix &) const
| Get the matrix associated with the geometry data.
bool | matrixIsIdentity (MStatus *ReturnStatus=NULL) const
| Return true if the matrix is the identity.
bool | matrixIsNotIdentity (MStatus *ReturnStatus=NULL) const
| Return true if the matrix is different from identity.
bool | hasObjectGroup (unsigned int id, MStatus *ReturnStatus=NULL) const
| This method returns true if an object group with the given id is contained in the data.
MStatus | addObjectGroup (unsigned int)
| This method adds an object group with the given id to the object.
MStatus | removeObjectGroup (unsigned int)
| This method removes an object group with the given id from the object.
MStatus | changeObjectGroupId (unsigned int, unsigned int)
| This method changes the id of the object group with the given id to the new id.
unsigned int | objectGroupCount (MStatus *ReturnStatus=NULL) const
| This method returns the number of object groups contained by the object.
unsigned int | objectGroup (unsigned int index, MStatus *ReturnStatus=NULL) const
| This method returns the id of the i'th object group contained by the object.
MFn::Type | objectGroupType (unsigned int, MStatus *ReturnStatus=NULL) const
| This method returns the type of the component that the object group with the given id contains.
MObject | objectGroupComponent (unsigned int, MStatus *ReturnStatus=NULL) const
| This method returns a component which contains the members of the object group with the given id.
MStatus | setObjectGroupComponent (unsigned int, MObject &)
| This method sets the members of the object group with the given id to be only those in the given component.
MStatus | addObjectGroupComponent (unsigned int, MObject &)
| This method adds the members of the given component to the object group with the given id.
MStatus | removeObjectGroupComponent (unsigned int, MObject &)
| This method removes the members of the given component from the object group with the given id.
MStatus | copyObjectGroups (MObject &inGeom)
| Copies the object groups from the given geometry data object.
| MFnGeometryData (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

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

MFnGeometryData | ( | 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::kGeometryData.

Reimplemented from MFnData.

Reimplemented in MFnLatticeData, MFnMeshData, MFnNurbsCurveData, MFnNurbsSurfaceData, and MFnSubdData.

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

Search for all occurrences

Class name.

Return the class name : "MFnGeometryData".

Reimplemented from MFnData.

Reimplemented in MFnLatticeData, MFnMeshData, MFnNurbsCurveData, MFnNurbsSurfaceData, and MFnSubdData.

MStatus setMatrix | ( | const MMatrix & | matrix | ) |

Search for all occurrences

Reset the matrix the the specified matrix and set the identity flag if the new matrix is the identity.

Parameters:

  [in] | matrix | the new matrix to be set

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus getMatrix | ( | MMatrix & | matrix | ) | const

Search for all occurrences

Get the matrix associated with the geometry data.

Parameters:

  [out] | matrix | storage for the returned matrix

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

bool matrixIsIdentity | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Return true if the matrix is the identity.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  True if the matrix for the geometry is identity, false otherwise

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

bool matrixIsNotIdentity | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Return true if the matrix is different from identity.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  True if the matrix for the geometry is NOT the identity, false otherwise

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

bool hasObjectGroup | ( | unsigned int | id,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

This method returns true if an object group with the given id is contained in the data.

Parameters:

  [in] | id | group id.
  [out] | ReturnStatus | return status

Returns:
  True is there is an object group with the given id, false otherwise

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus addObjectGroup | ( | unsigned int | id | ) |

Search for all occurrences

This method adds an object group with the given id to the object.

Parameters:

  [in] | id | group id.

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus removeObjectGroup | ( | unsigned int | id | ) |

Search for all occurrences

This method removes an object group with the given id from the object.

Parameters:

  [in] | id | group id.

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus changeObjectGroupId | ( | unsigned int | sourceId,
|  | unsigned int | destId
| ) |  |

Search for all occurrences

This method changes the id of the object group with the given id to the new id.

Parameters:

  [in] | sourceId | id to change
  [in] | destId | new id to set

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

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

Search for all occurrences

This method returns the number of object groups contained by the object.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The number of object groups

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

unsigned int objectGroup | ( | unsigned int | index,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

This method returns the id of the i'th object group contained by the object.

Parameters:

  [out] | index | index in the group array.
  [out] | ReturnStatus | return status

Returns:
  The id of the i'th object group

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MFn::Type objectGroupType | ( | unsigned int | id,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

This method returns the type of the component that the object group with the given id contains.

Parameters:

  [in] | id | group id.
  [out] | ReturnStatus | return status

Returns:
  The type of the specified object group component

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MObject objectGroupComponent | ( | unsigned int | id,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

This method returns a component which contains the members of the object group with the given id.

Parameters:

  [in] | id | group id.
  [out] | ReturnStatus | return status

Returns:
  A component containing the members of the specified object group

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus setObjectGroupComponent | ( | unsigned int | id,
|  | MObject & | component
| ) |  |

Search for all occurrences

This method sets the members of the object group with the given id to be only those in the given component.

Parameters:

  [in] | id | id of object group to set
  [in] | component | new component for specified object group. The component should be an MObject created from any function set derived from MFnComponent (ie. MFnSingleIndexedComponent, MFnDoubleIndexedComponent, MFnTripleIndexedComponent)

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus addObjectGroupComponent | ( | unsigned int | id,
|  | MObject & | component
| ) |  |

Search for all occurrences

This method adds the members of the given component to the object group with the given id.

Parameters:

  [in] | id | id of object group to add to
  [in] | component | new component to be added to the specified object group. The component should be an MObject created from any function set derived from MFnComponent (ie. MFnSingleIndexedComponent, MFnDoubleIndexedComponent, MFnTripleIndexedComponent)

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus removeObjectGroupComponent | ( | unsigned int | id,
|  | MObject & | component
| ) |  |

Search for all occurrences

This method removes the members of the given component from the object group with the given id.

Parameters:

  [in] | id | id of object group to be changed
  [in] | component | component specifying the members to be removed. The component should be an MObject created from any function set derived from MFnComponent (ie. MFnSingleIndexedComponent, MFnDoubleIndexedComponent, MFnTripleIndexedComponent)

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid object

MStatus copyObjectGroups | ( | MObject & | inGeom | ) |

Search for all occurrences

Copies the object groups from the given geometry data object.

Parameters:

  [in] | inGeom | the geometry data to be copied

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter parameter is not a kGeometryData type
  - MS::kFailure this function set does not have a valid object

MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData
MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData MFnGeometryData