C++ API Reference

Geometry data function set. More...

#include <MFnGeometryData.h>

+ Inheritance diagram for MFnGeometryData:

Public Types

enum  ComponentTagCategory
 Component tag type.
 
enum  SubsetState
 Group contents.
 
- Public Types inherited from MFnData
enum  Type {
  kInvalid, kNumeric, kPlugin, kPluginGeometry,
  kString, kMatrix, kStringArray, kDoubleArray,
  kFloatArray, kIntArray, kPointArray, kVectorArray,
  kMatrixArray, kComponentList, kMesh, kLattice,
  kNurbsCurve, kNurbsSurface, kSphere, kDynArrayAttrs,
  kDynSweptGeometry, kSubdSurface, kNObject, kNId,
  kAny, kFalloffFunction
}
 Types of dependency graph data. More...
 

Public Member Functions

virtual MFn::Type type () const
 Function set type. More...
 
virtual ~MFnGeometryData ()
 Destructor.
 
 MFnGeometryData ()
 Default constructor.
 
 MFnGeometryData (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
MStatus setMatrix (const MMatrix &)
 Reset the matrix the the specified matrix and set the identity flag if the new matrix is the identity. More...
 
MStatus getMatrix (MMatrix &) const
 Get the matrix associated with the geometry data. More...
 
bool matrixIsIdentity (MStatus *ReturnStatus=NULL) const
 Return true if the matrix is the identity. More...
 
bool matrixIsNotIdentity (MStatus *ReturnStatus=NULL) const
 Return true if the matrix is different from identity. More...
 
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. More...
 
MStatus addObjectGroup (unsigned int)
 This method adds an object group with the given id to the object. More...
 
MStatus removeObjectGroup (unsigned int)
 This method removes an object group with the given id from the object. More...
 
MStatus changeObjectGroupId (unsigned int, unsigned int)
 This method changes the id of the object group with the given id to the new id. More...
 
unsigned int objectGroupCount (MStatus *ReturnStatus=NULL) const
 This method returns the number of object groups contained by the object. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
MStatus addObjectGroupComponent (unsigned int, MObject &)
 This method adds the members of the given component to the object group with the given id. More...
 
MStatus removeObjectGroupComponent (unsigned int, MObject &)
 This method removes the members of the given component from the object group with the given id. More...
 
SubsetState objectGroupSubsetState (unsigned int, MStatus *ReturnStatus=NULL) const
 This method returns the state of the contents of the component that the object group with the given id contains. More...
 
MStatus copyObjectGroups (MObject &inGeom)
 Copies the object groups from the given geometry data object. More...
 
MStatus componentTags (MStringArray &keys) const
 Get the componentTag keys associated with the geometry data. More...
 
bool hasComponentTag (const MString &key, MStatus *ReturnStatus=NULL) const
 This method returns true if a componentTag with the given key is contained in the data. More...
 
MStatus addComponentTag (const MString &key)
 This method adds a componentTag with the given key to the object. More...
 
MStatus removeComponentTag (const MString &key)
 This method removes a componentTag with the given key from the object. More...
 
MStatus renameComponentTag (const MString &key, const MString &newKey)
 This method renames a componentTag with the given key to a new key. More...
 
MObject componentTagContents (const MString &key, MStatus *ReturnStatus=NULL) const
 This method returns a component which contains the members of the object group with the given id. More...
 
MStatus setComponentTagContents (const MString &key, MObject &)
 This method sets the members of the object group with the given id to be only those in the given component. More...
 
MFn::Type componentTagType (const MString &key, MStatus *ReturnStatus=NULL) const
 This method returns the type of the component the componentTag with the given key contains. More...
 
ComponentTagCategory componentTagCategory (const MString &key, MStatus *ReturnStatus=NULL) const
 This method returns the category of the component the componentTag with the given key contains. More...
 
SubsetState componentTagExpressionSubsetState (const MString &expression, ComponentTagCategory ctg=MFnGeometryData::ComponentTagCategory::kAuto, MStatus *ReturnStatus=NULL) const
 This method returns the state of the contents of the component that is defined by the given componentTag expression. More...
 
MObject resolveComponentTagExpression (const MString &expression, ComponentTagCategory ctg=MFnGeometryData::ComponentTagCategory::kAuto, MStatus *ReturnStatus=NULL) const
 This method returns the resolved component that is defined by the given componentTag expression. More...
 
 MFnGeometryData (const MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
- Public Member Functions inherited from MFnData
virtual ~MFnData ()
 Destructor.
 
 MFnData (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
 MFnData ()
 Default class constructor.
 
 MFnData (const MObject &object, MStatus *ReturnStatus=NULL)
 Constructor. More...
 
- Public Member Functions inherited from MFnBase
virtual ~MFnBase ()
 Class Destructor. More...
 
bool hasObj (MFn::Type) const
 Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More...
 
bool hasObj (const MObject &) const
 Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More...
 
MObject object (MStatus *ReturnStatus=nullptr) const
 Returns the MObject that is attached to the Function Set. More...
 
virtual MStatus setObject (MObject &object)
 Attaches the Function Set to the specified Maya Object. More...
 
virtual MStatus setObject (const MObject &object)
 NO SCRIPT SUPPORT. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MFnData
static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MFnBase
static const char * className ()
 Returns the name of this class. More...
 
static const char * typeString (MFn::Type)
 Returns the type string for a given type. More...
 
static bool isValid (MFn::Type)
 Returns true if type is in the range of valid types. More...
 

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.

Examples:
customComponentTagNode/customComponentTagNode.cpp.

Constructor & Destructor Documentation

MFnGeometryData ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

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

Parameters
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe 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]objectThe MObject to attach the function set to
[out]ReturnStatusthe 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

Function set type.

Return the class type : MFn::kGeometryData.

Returns
the class type.

Reimplemented from MFnData.

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

OPENMAYA_MAJOR_NAMESPACE_OPEN const char * className ( )
static

Returns the name of this class.

Return the class name : "MFnGeometryData".

Returns
Name of this class.
MStatus setMatrix ( const MMatrix matrix)

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

Parameters
[in]matrixthe 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

Get the matrix associated with the geometry data.

Parameters
[out]matrixstorage 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

Return true if the matrix is the identity.

Parameters
[out]ReturnStatusreturn 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

Return true if the matrix is different from identity.

Parameters
[out]ReturnStatusreturn 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

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

Parameters
[in]idgroup id.
[out]ReturnStatusreturn 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)

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

Parameters
[in]idgroup 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)

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

Parameters
[in]idgroup 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 
)

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

Parameters
[in]sourceIdid to change
[in]destIdnew 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

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

Parameters
[out]ReturnStatusreturn 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

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

Parameters
[out]indexindex in the group array.
[out]ReturnStatusreturn 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

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

Parameters
[in]idgroup id.
[out]ReturnStatusreturn 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

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

Parameters
[in]idgroup id.
[out]ReturnStatusreturn 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 
)

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

Parameters
[in]idid of object group to set
[in]componentnew 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 
)

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

Parameters
[in]idid of object group to add to
[in]componentnew 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 
)

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

Parameters
[in]idid of object group to be changed
[in]componentcomponent 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
MFnGeometryData::SubsetState objectGroupSubsetState ( unsigned int  id,
MStatus ReturnStatus = NULL 
) const

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

Parameters
[in]idgroup id.
[out]ReturnStatusreturn status
Returns
The group contents of the specified object group component
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MStatus copyObjectGroups ( MObject inGeom)

Copies the object groups from the given geometry data object.

Parameters
[in]inGeomthe 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
MStatus componentTags ( MStringArray keys) const

Get the componentTag keys associated with the geometry data.

Parameters
[out]keysstorage for the array of keys
Returns
Status code
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
bool hasComponentTag ( const MString key,
MStatus ReturnStatus = NULL 
) const

This method returns true if a componentTag with the given key is contained in the data.

Parameters
[in]keycomponentTag key
[out]ReturnStatusreturn status
Returns
True is there is a componentTag with the given key, false otherwise
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MStatus addComponentTag ( const MString key)

This method adds a componentTag with the given key to the object.

Parameters
[in]keycomponentTag key
Returns
Status code
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MStatus removeComponentTag ( const MString key)

This method removes a componentTag with the given key from the object.

Parameters
[in]keycomponentTag key
Returns
Status code
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MStatus renameComponentTag ( const MString key,
const MString newKey 
)

This method renames a componentTag with the given key to a new key.

Parameters
[in]keycomponentTag key to be altered
[in]newKeythe new componentTag key to be used
Returns
Status code
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MObject componentTagContents ( const MString key,
MStatus ReturnStatus = NULL 
) const

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

Parameters
[in]keycomponentTag key
[out]ReturnStatusreturn 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 setComponentTagContents ( const MString key,
MObject component 
)

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

Parameters
[in]keykey of componentTag to set
[in]componentnew component for specified componentTag. 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
MFn::Type componentTagType ( const MString key,
MStatus ReturnStatus = NULL 
) const

This method returns the type of the component the componentTag with the given key contains.

Parameters
[in]keycomponentTag key
[out]ReturnStatusreturn status
Returns
The type of the specified componentTag component
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MFnGeometryData::ComponentTagCategory componentTagCategory ( const MString key,
MStatus ReturnStatus = NULL 
) const

This method returns the category of the component the componentTag with the given key contains.

Parameters
[in]keycomponentTag key
[out]ReturnStatusreturn status
Returns
The type of the specified componentTag component
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MFnGeometryData::SubsetState componentTagExpressionSubsetState ( const MString expression,
ComponentTagCategory  ctg = MFnGeometryData::ComponentTagCategory::kAuto,
MStatus ReturnStatus = NULL 
) const

This method returns the state of the contents of the component that is defined by the given componentTag expression.

Parameters
[in]expressioncomponentTag expression
[in]ctgthe component category the expression must be resolved to
[out]ReturnStatusreturn status
Returns
The state of the contents of the resolved expression
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure this function set does not have a valid object
MObject resolveComponentTagExpression ( const MString expression,
ComponentTagCategory  ctg = MFnGeometryData::ComponentTagCategory::kAuto,
MStatus ReturnStatus = NULL 
) const

This method returns the resolved component that is defined by the given componentTag expression.

Parameters
[in]expressioncomponentTag expression
[in]ctgthe component category the expression must be resolved to
[out]ReturnStatusreturn 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

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