class MItMeshPolygon

Jump to documentation

Polygon iterator. (OpenMaya) (OpenMaya.py)

public members:

MItMeshPolygon ( const MObject & polyObject, MStatus * ReturnStatus = NULL )
MItMeshPolygon ( const MDagPath &polyObject, MObject & component = MObject::kNullObj , MStatus * ReturnStatus = NULL )
virtual ~MItMeshPolygon ()
bool isDone ( MStatus * ReturnStatus = NULL )
MStatus next ()
MStatus reset ()
MStatus reset ( const MObject & polyObject )
MStatus reset ( const MDagPath &polyObject, MObject & component = MObject::kNullObj )
unsigned int count ( MStatus * ReturnStatus = NULL )
unsigned int polygonVertexCount ( MStatus * ReturnStatus = NULL )
MPoint center ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MObject polygon ( MStatus * ReturnStatus = NULL )
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL )
unsigned int index ( MStatus * ReturnStatus = NULL )
MStatus setIndex (int index , int &prevIndex)
unsigned int vertexIndex ( int index , MStatus * ReturnStatus = NULL )
MStatus getVertices ( MIntArray & vertices )
MPoint point ( int index , MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
void getPoints ( MPointArray & pointArray, MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MStatus setPoint ( const MPoint & point , unsigned int index , MSpace::Space space = MSpace::kObject )
MStatus setPoints ( MPointArray & pointArray, MSpace::Space space = MSpace::kObject )
unsigned int normalIndex ( int vertex, MStatus * ReturnStatus = NULL) const
MStatus getNormal ( MVector & normal, MSpace::Space space = MSpace::kObject ) const
MStatus getNormal ( unsigned int Vertexindex, MVector & normal, MSpace::Space space = MSpace::kObject ) const
MStatus getNormals ( MVectorArray & vectorArray, MSpace::Space space = MSpace::kObject ) const
unsigned int tangentIndex ( int vertex, MStatus * ReturnStatus = NULL ) const
bool hasUVs ( MStatus * ReturnStatus = NULL ) const
bool hasUVs ( const MString & uvSet, MStatus * ReturnStatus = NULL ) const
MStatus setUV ( int vertexId, float2 & uvPoint, const MString * uvSet = NULL)
MStatus getUV ( int vertexId, float2 & uvPoint, const MString * uvSet = NULL) const
MStatus setUVs ( MFloatArray & uArray, MFloatArray & vArray, const MString * uvSet = NULL)
MStatus getUVs ( MFloatArray & uArray, MFloatArray & vArray, const MString * uvSet = NULL) const
MStatus getPointAtUV ( MPoint &pt, float2 & uvPoint, MSpace::Space space = MSpace::kObject , const MString * uvSet = NULL, float tolerance=0.0 )
MStatus getUVAtPoint ( MPoint &pt, float2 & uvPoint, MSpace::Space space = MSpace::kObject , const MString * uvSet = NULL)
MStatus getUVIndex ( int vertex, int & index , const MString *uvSet = NULL )
MStatus getUVIndex ( int vertex, int & index , float & u, float & v, const MString *uvSet = NULL)
MStatus getUVSetNames ( MStringArray &setNames) const
bool hasColor ( MStatus * ReturnStatus = NULL ) const
bool hasColor (int localVertexIndex, MStatus * ReturnStatus = NULL )
MStatus getColor ( MColor &color, const MString *colorSetName = NULL)
MStatus getColor ( MColor &color, int vertexIndex )
MStatus getColors ( MColorArray &colors, const MString *colorSetName = NULL)
MStatus numColors ( int & count , const MString *colorSetName = NULL )
MStatus getColorIndex (int vertexIndex , int & colorIndex, const MString *colorSetName = NULL)
MStatus getColorIndices ( MIntArray & colorIndex, const MString *colorSetName = NULL)
bool hasValidTriangulation ( MStatus * ReturnStatus = NULL) const
MStatus numTriangles (int & count ) const
MStatus getTriangle ( int localTriIndex, MPointArray & points, MIntArray & vertexList, MSpace::Space space = MSpace::kObject ) const
MStatus getTriangles ( MPointArray & points, MIntArray & vertexList, MSpace::Space space = MSpace::kObject ) const
MStatus updateSurface ()
MStatus geomChanged ()
MStatus getEdges ( MIntArray & edges )
MStatus getConnectedFaces ( MIntArray & faces)
MStatus getConnectedEdges ( MIntArray & edges )
MStatus getConnectedVertices ( MIntArray & vertices )
bool isConnectedToFace ( int index , MStatus * ReturnStatus = NULL)
bool isConnectedToEdge ( int index , MStatus * ReturnStatus = NULL)
bool isConnectedToVertex ( int index , MStatus * ReturnStatus = NULL)
MStatus numConnectedFaces (int & faceCount ) const
MStatus numConnectedEdges (int & edgeCount) const
bool onBoundary ( MStatus * ReturnStatus = NULL )
MStatus getArea (double &area, MSpace::Space space = MSpace::kObject )
bool zeroArea ( MStatus * ReturnStatus = NULL)
MStatus getUVArea (double &area, const MString * uvSet = NULL)
bool zeroUVArea ( MStatus * ReturnStatus = NULL)
bool zeroUVArea ( const MString & uvSet, MStatus * ReturnStatus = NULL)
bool isConvex ( MStatus * ReturnStatus = NULL)
bool isStarlike ( MStatus * ReturnStatus = NULL)
bool isLamina ( MStatus * ReturnStatus = NULL)
bool isHoled ( MStatus * ReturnStatus = NULL)
bool isPlanar ( MStatus * ReturnStatus = NULL)

Documentation

Iterate over polygonal surfaces
Description

This class is the iterator for polygonal surfaces (meshes).

The iterator functions in two modes depending on whether a component is specified. When a component is not given or is NULL the iteration will be over all polygons for the surface. When a component is given this iterator will iterate over the polygons (faces) specified in the component. When iterating over components a DAG path to the surface must also be supplied.

Functions

MItMeshPolygon:: MItMeshPolygon ( const MObject & polyObject, MStatus * ReturnStatus )

Description

Constructor.
Creates an iterator for all polygons of the given surface.

Arguments

  • polyObject The surface to iterate over
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MItMeshPolygon:: MItMeshPolygon ( const MDagPath &polyObject, MObject & component, MStatus * ReturnStatus )

Description

Constructor.
Creates an iterator for the polygons of the given component. If no component is specified then the iteration will be for all polygons of the given surface.

Arguments

  • polyObject The surface (mesh) to iterate over
  • component The polygons of the polyObject to iterate over
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MItMeshPolygon:: ~MItMeshPolygon ()

Description

Destructor.
Frees up storage used by the iterator.

bool MItMeshPolygon:: isDone ( MStatus * ReturnStatus )

Description

Indicates if all of the polygons have been traversed yet.

Arguments

  • ReturnStatus Status code

Return Value

  • true All polygons have been traversed
  • false There are more polygons in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: next ()

Description

Advance to the next polygon in the iteration.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: reset ()

Description

Reset the iterator to the first polygon.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: reset ( const MObject & polyObject )

Description

Reset the iterator to the first polygon in the supplied surface.

Arguments

  • polyObject The polygon for the iteration

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: geomChanged ()

Description

Reset the geom pointer in the MItMeshPolygon. This is now being handled automatically inside the iterator, and users should no longer need to call this method directly to sync up the iterator to changes made by MFnMesh

Arguments

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: reset ( const MDagPath &polyObject, MObject & component )

Description

Reset the iterator with the given surface and component. If component is null then the iteration will be for all polygons in the given surface.

Arguments

  • polyObject The surface (mesh) to iterate over
  • component The polygons (faces) of the polyObject to iterate over

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MPoint MItMeshPolygon:: center ( MSpace::Space space, MStatus * ReturnStatus )

Description

Return the position of the center of the current polygon.

Arguments

  • space The coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • The center of the current polygon

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MItMeshPolygon:: count ( MStatus * ReturnStatus )

Description

Return the number of polygons in the iteration.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of polygons in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MItMeshPolygon:: polygonVertexCount ( MStatus * ReturnStatus )

Description

Return the number of vertices for the current polygon.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of vertices for the current polygon

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MPoint MItMeshPolygon:: point ( int index , MSpace::Space space, MStatus * ReturnStatus )

Description

Return the position of the vertex at index in the current polygon.

Arguments

  • index The face-relative index of the vertex in the current polygon
  • space The coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • The vertex position

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MItMeshPolygon:: getPoints ( MPointArray & pointArray, MSpace::Space space, MStatus * ReturnStatus )

Description

Retrieves the positions of the vertices on the current face/polygon that the iterator is pointing to. Vertex positions will be inserted into the given array and will be indexed using face-relative vertex IDs (ie. ordered from 0 to (vertexCount of the face) - 1), which should not be confused with the vertexIDs of each vertex in relation to the entire mesh object.

Arguments

  • pointArray The array where the vertex positions will be stored
  • space The coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • None

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: setPoint ( const MPoint & point , unsigned int index , MSpace::Space space )

Description

Set the vertex at the given index in the current polygon.

Arguments

  • point The new position for the vertex
  • index The face-relative index of the vertex in the current polygon
  • space The coordinate system for this operation

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: setPoints ( MPointArray & pointArray, MSpace::Space space )

Description

Sets new locations for vertices of the current polygon that the iterator is pointing to.

Arguments

  • pointArray The new positions for the vertices.
  • space The coordinate system for this operation.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MItMeshPolygon:: index ( MStatus * ReturnStatus )

Description

Returns the index of the current polygon.

Arguments

  • ReturnStatus Status code

Return Value

  • The index of the current polygon

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

unsigned int MItMeshPolygon:: vertexIndex ( int index , MStatus * ReturnStatus )

Description

Returns the object-relative index of the specified vertex of the current polygon. The index returned may be used to refer to an element in the vertex list returned by MFnMesh::getPoints.

Arguments

  • index The face-relative index of the vertex in the polygon
  • ReturnStatus Status code

Return Value

  • The index in the polygon array of the given vertex

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

unsigned int MItMeshPolygon:: normalIndex ( int localVertexIndex, MStatus * ReturnStatus ) const
Description

Returns the normal index for the specified vertex. This index refers to an element in the normal array returned by MFnMesh::getNormals. These normals are per-polygon per-vertex normals. See the MFnMesh description for more information on normals.

Arguments

  • localVertexIndex The face-relative index of the vertex to examine for the current polygon
  • ReturnStatus Status code

Return Value

  • The index of the normal for the specified vertex

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

unsigned int MItMeshPolygon:: tangentIndex ( int localVertexIndex, MStatus * ReturnStatus ) const
Description

Returns the tangent (or binormal) index for the specified vertex. This index refers to an element in the normal array returned by MFnMesh::getTangents. These tangent or binormals are per-polygon per-vertex. See the MFnMesh description for more information on tangents and binormals.

Arguments

  • localVertexIndex The face-relative index of the vertex to examine for the current polygon
  • ReturnStatus Status code

Return Value

  • The index of the tangent for the specified vertex

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getUVIndex ( int vertex, int & index , const MString *uvSet )

Description

Returns the index of the texture coordinate for the given vertex. This index refers to an element of the texture coordinate array for the polygonal object returned by MFnMesh::getUVs.

Arguments

  • vertex The face-relative vertex index of the current polygon
  • index Storage for the texture coordinate index of the specified vertex
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter An invalid vertex index given. The vertex index must be less than polygonVertexCount() and must also be mapped by the specified uvSet.

MStatus MItMeshPolygon:: getUVIndex ( int vertex, int & index , float & u, float & v, const MString *uvSet )

Description

Return the index of the texture coordinate for the given vertex. This index refers to an element of the texture coordinate array for the polygonal object returned by MFnMesh::getUVs.

Arguments

  • vertex The face-relative vertex index of the current polygon
  • index Storage for the texture coordinate index of the specified vertex
  • u Storage for u value
  • v Storage for v value
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter An invalid vertex index given. The vertex index must be less than polygonVertexCount() and must also be mapped by the specified uvSet.

MStatus MItMeshPolygon:: getUVSetNames ( MStringArray &setNames) const
Description

This method is used to find the UV set names mapped to the current face.

Arguments

  • setNames The string array to return the UV sets names in

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred or an internal error.

MObject MItMeshPolygon:: polygon ( MStatus * ReturnStatus )

Description

This method is OBSOLETE, please use the currentItem method.

Get the current polygon in the iteration as a component.

Components are used to specify one or more polygons and are usefull in operating on groups of non-contiguous polygons for a surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • ReturnStatus Status code

Return Value

  • The current polygon in the interation

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MObject MItMeshPolygon:: currentItem ( MStatus * ReturnStatus )

Description

Get the current polygon in the iteration as a component.

Components are used to specify one or more polygons and are usefull in operating on groups of non-contiguous polygons for a surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • ReturnStatus Status code

Return Value

  • The current polygon in the interation

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getNormal ( MVector & normal, MSpace::Space space ) const

Description

Return the face normal of the current polygon.

Arguments

  • normal Storage for the normal
  • space The transformation space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Unable to do world space transfromation.

MStatus MItMeshPolygon:: getNormal ( unsigned int index , MVector & normal, MSpace::Space space ) const

Description

Returns the vertex-face normal for the vertex in the current polygon.

Arguments

  • index face-relative vertex index of the vertex whose normal to retrieve
  • normal Storage for the normal
  • space The transformation space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Unable to do world space transfromation.

MStatus MItMeshPolygon:: getNormals ( MVectorArray & normalArray, MSpace::Space space ) const

Description

Returns the normals for all vertices in the current face

Arguments

  • normalArray Storage for the normals
  • space The transformation space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Unable to do world space transfromation.

MStatus MItMeshPolygon:: updateSurface ()

Description

Signal that this polygonal surface has changed and needs to redraw itself.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: setIndex ( int index , int &prevIndex )

Description

This method sets the index of the current face to be accessed. The current face will no longer be in sync with any previous iteration.

Arguments

  • index The index of desired face to access.
  • prevIndex The index of the current face in the iteration

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getEdges ( MIntArray & edges )

Description

This method gets the indices of the edges contained in the current face.

Arguments

  • edges An array to place all the edge indices into

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getVertices ( MIntArray & vertices)

Description

This method gets the indices of the vertices of the current face

Arguments

  • vertices An array to place all the vertex indices into

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getConnectedFaces ( MIntArray & faces )

Description

This method gets the indices of the faces connected to the current face.

Arguments

  • faces An array to place all the face indices into

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getConnectedEdges ( MIntArray & edges )

Description

This method gets the indices of the edges connected to the vertices of the current face, but DOES not include the edges contained in the current face

Arguments

  • edges An array to place all the edge indices into

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getConnectedVertices ( MIntArray & vertices)

Description

This method gets the object-relative indices of the vertices surrounding the vertices of the current face, but does not include the vertices of the current face

Arguments

  • vertices An array to stuff all the vertex indices into

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isConnectedToFace ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given face is adjacent to the current face

Arguments

  • index Index of the face to be tested for
  • ReturnStatus Status code

Return Value

  • TRUE if connected, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isConnectedToEdge ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given edge is connected to a vertex in the current face

Arguments

  • index Index of the edge to be tested for
  • ReturnStatus Status code

Return Value

  • TRUE if connected, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isConnectedToVertex ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given vertex shares an edge with a vertex in the current face.

Arguments

  • index Index of the vertex to be tested for
  • ReturnStatus Status code

Return Value

  • TRUE if connected, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: numConnectedFaces ( int & faceCount ) const

Description

This method checks for the number of connected faces

Arguments

  • faceCount Storage for the face count

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: numConnectedEdges ( int & edgeCount ) const

Description

This method checks for the number of connected edges on the vertices of this face

Arguments

  • edgeCount Storage for the edge count

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MItMeshPolygon:: onBoundary ( MStatus * ReturnStatus)

Description

This method determines whether the current face is on a boundary

Arguments

  • ReturnStatus Status code

Return Value

  • TRUE if on a boundary, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: hasColor ( MStatus * ReturnStatus) const

Description

This method determines whether the current face has color-per-vertex set for any vertex.

Arguments

  • ReturnStatus Status code

Return Value

  • TRUE if at least one vertex has color, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: hasColor (int vertexIndex , MStatus * ReturnStatus)

Description

This method determines whether the current face has color-per-vertex set for the given vertex.

Arguments

  • vertexIndex face-relative vertex index to check for color on
  • ReturnStatus Status code

Return Value

  • TRUE if the given vertex has color, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getColor ( MColor &color, int index )

Description

This method gets the color of the specifed vertex in this face

Arguments

  • color The color to get
  • index The face-relative vertex index on this face

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getColor ( MColor &color, const MString *colorSetName)

Description

This method gets the average color of the all the vertices in this face

Arguments

  • color The average color
  • colorSetName Name of the color set.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getColors ( MColorArray &colors, const MString *colorSetName)

Description

This method gets the color of the each vertex in the current face.

Arguments

  • colors Storage for the colors of the vertice in this face
  • colorSetName Name of the color set.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: numColors ( int & colorCount, const MString *colorSetName )

Description

This method checks for the number of colors on vertices in this face.

Arguments

  • colorCount Storage for the color count
  • colorSetName Name of the color set.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getColorIndex (int vertexIndex , int & colorIndex, const MString *colorSetName)

Description

This method returns the current colorIndex.

Arguments

  • colorIndex Color index filled in this function.
  • colorSetName Name of the color set.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getColorIndices ( MIntArray & colorIndices, const MString *colorSetName)

Description

This method returns the colorIndices for each vertex on the face.

Arguments

  • colorIndices Color index filled in this function.
  • colorSetName Name of the color set.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MItMeshPolygon:: hasUVs ( MStatus * ReturnStatus) const

Description

Tests whether this face has UV's mapped or not (either all the vertices for a face should have UV's, or none of them do, so the UV count for a face is either 0, or equal to the number of vertices).

Arguments

  • ReturnStatus Status code

Return Value

  • true if the face has UV's mapped, false otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MItMeshPolygon:: hasUVs (const MString &uvSet, MStatus * ReturnStatus) const

Description

Tests whether this face has UV's mapped or not (either all the vertices for a face should have UV's, or none of them do, so the UV count for a face is either 0, or equal to the number of vertices).

Arguments

  • uvSet UV set to work with
  • ReturnStatus Status code

Return Value

  • true if the face has UV's mapped, false otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: setUV ( int vertexId,float2 & uvPoint, const MString *uvSet )

Description

Modify the UV value for the given vertex in the current face. If the face is not already mapped, this method will fail.

Arguments

  • vertexId face-relative index of the vertex to set UV for.
  • uvPoint The UV values to set it to
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getUV ( int vertex, float2 &uvPoint, const MString *uvSet ) const

Description

Return the texture coordinate for the given vertex.

Arguments

  • vertex The face-relative vertex index to get UV for
  • uvPoint Storage for u and v values
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid vertex index given. The vertex index must be less than polygonVertexCount() and must also be mapped by the specified uvSet.

MStatus MItMeshPolygon:: setUVs ( MFloatArray & uArray, MFloatArray & vArray, const MString *uvSet )

Description

Modify the UV value for all vertices in the current face. If the face has not already been mapped, this method will fail.

Arguments

  • uArray All the U values - in local face order
  • vArray The corresponding V values
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getUVs ( MFloatArray & uArray, MFloatArray & vArray, const MString *uvSet ) const

Description

Return the all the texture coordinates for the vertices of this face (in local vertex order).

Arguments

  • uArray Storage for u values
  • vArray Storage for v values
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid vertex index given. The vertex index must be less than polygonVertexCount() and must also be mapped by the specified uvSet.

MStatus MItMeshPolygon:: getPointAtUV ( MPoint &pt, float2 & uvPoint, MSpace::Space space, const MString *uvSet, float tolerance )

Description

Return the position of the point at the given UV value in the current polygon.

Arguments

  • pt Space for the point
  • uvPoint The UV value to try to locate
  • space The coordinate system for this operation
  • uvSet UV set to work with
  • tolerance tolerance value to compare float data type

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getUVAtPoint ( MPoint &pt, float2 & uvPoint, MSpace::Space space, const MString * uvSet )

Description

Find the point closet to the given point in the current polygon, and return the UV value at that point.

Arguments

  • pt The point to try to get UV for
  • uvPoint Space for the UV value
  • space The coordinate system for this operation
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getArea ( double &area, MSpace::Space space )

Description

This method gets the area of the face

Arguments

  • area The area
  • space World Space or Object Space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: getUVArea ( double &area, const MString *uvSet )

Description

This method gets the UV area of the face

Arguments

  • area The uv area
  • uvSet UV set to work with

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: zeroArea ( MStatus * ReturnStatus )

Description

This method checks if its a zero area face

Arguments

  • ReturnStatus Status code

Return Value

  • true the face has zero area
  • false the face has non-zero area

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: zeroUVArea ( MStatus * ReturnStatus )

Description

This method checks if the UV area of the face is zero

Arguments

  • ReturnStatus Status code

Return Value

  • true the face has zero UV area
  • false the face has non-zero UV area

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: zeroUVArea ( const MString &uvSet, MStatus * ReturnStatus )

Description

This method checks if the UV area of the face is zero

Arguments

  • uvSet UV set to work with
  • ReturnStatus Status code

Return Value

  • true the face has zero UV area
  • false the face has non-zero UV area

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: hasValidTriangulation ( MStatus * ReturnStatus ) const

Description

This method checks if the face has a valid triangulation. If it doesn't, then the face was bad geometry: it may gave degenerate points or cross over itself.

Arguments

  • ReturnStatus Status code

Return Value

  • true the face has a valid triangulation
  • false the face does not have a valid triangulation

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshPolygon:: numTriangles ( int & triCount ) const

Description

This Method checks for the number of triangles in this face in the current triangulation

Arguments

  • triCount Storage for the triangle count

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getTriangle (int localTriIndex, MPointArray & points, MIntArray & vertexList, MSpace::Space space ) const

Description

Get the vertices and vertex positions of the given triangle in the current face's triangulation.

Arguments

  • localTriIndex Local index of the desired triangle in this face
  • points Storage for all the vertex points
  • vertexList Storage for all the vertex indices
  • space World Space or Object Space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshPolygon:: getTriangles ( MPointArray & points, MIntArray & vertexList, MSpace::Space space ) const

Description

Get the vertices and vertex positions of all the triangles in the current face's triangulation.

Arguments

  • points Storage for all the vertex points
  • vertexList Storage for all the vertex indices
  • space World Space or Object Space

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MItMeshPolygon:: isConvex ( MStatus * ReturnStatus )

Description

This method checks if the face is convex.

Arguments

  • ReturnStatus Status code

Return Value

  • true the face is convex
  • false the face not convex

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isStarlike ( MStatus * ReturnStatus )

Description

This method checks if the face is starlike. That is, a line from the centre to any vertex lies entirely within the face.

Arguments

  • ReturnStatus Status code

Return Value

  • true the face is starlike
  • false the face not starlike

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isLamina ( MStatus * ReturnStatus )

Description

This method checks if the face is a lamina (the face is folded over onto itself).

Arguments

  • ReturnStatus Status code

Return Value

  • true the face is a lamina
  • false the face not a lamina

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isHoled ( MStatus * ReturnStatus )

Description

This method checks if the face has any holes.

Arguments

  • ReturnStatus Status code

Return Value

  • true the face has one or more holes
  • false the face has no holes

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshPolygon:: isPlanar ( MStatus * ReturnStatus )

Description

This method checks if the face is planar

Arguments

  • ReturnStatus Status code

Return Value

  • true the face is planar
  • false the face not planar

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright