class MItMeshVertex

Jump to documentation

Polygon vertex iterator. (OpenMaya) (OpenMaya.py)

public members:

MItMeshVertex ( MObject & polyObject, MStatus * ReturnStatus = NULL )
MItMeshVertex ( const MDagPath &polyObject, MObject & component = MObject::kNullObj , MStatus * ReturnStatus = NULL )
virtual ~MItMeshVertex ()
bool isDone ( MStatus * ReturnStatus = NULL )
MStatus next ()
MStatus reset ()
MStatus reset ( MObject & polyObject )
MStatus reset ( const MDagPath &polyObject, MObject & component = MObject::kNullObj )
int count ( MStatus * ReturnStatus = NULL )
int index ( MStatus * ReturnStatus = NULL )
MObject vertex ( MStatus * ReturnStatus = NULL )
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL )
MPoint position ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MStatus setPosition ( const MPoint & point, MSpace::Space space = MSpace::kObject )
MStatus translateBy ( const MVector & vector, MSpace::Space space = MSpace::kObject )
MStatus getNormal ( MVector & vector, MSpace::Space space = MSpace::kObject )
MStatus getNormal ( MVector & vector, int faceIndex, MSpace::Space space = MSpace::kObject )
MStatus getNormals ( MVectorArray & vectorArray, MSpace::Space space = MSpace::kObject )
MStatus getNormalIndices ( MIntArray & normalIndices) const
MStatus numUVs ( int & count , const MString * uvSet = NULL)
MStatus setUV ( float2 & uvPoint, const MString * uvSet = NULL)
MStatus getUV ( float2 & uvPoint, const MString * uvSet = NULL)
MStatus setUV ( int faceId, float2 & uvPoint, const MString * uvSet = NULL)
MStatus getUV ( int faceId, float2 & uvPoint, const MString * uvSet = NULL) const
MStatus setUVs ( MFloatArray & uArray, MFloatArray & vArray, MIntArray & faceIds, const MString * uvSet = NULL )
MStatus getUVs ( MFloatArray & uArray, MFloatArray & vArray, MIntArray & faceIds, const MString * uvSet = NULL) const
MStatus getUVIndices ( MIntArray & uvIndices, const MString * uvSet = NULL) const
MStatus updateSurface ()
MStatus geomChanged ()
MStatus setIndex (int index , int &prevIndex)
MStatus getConnectedFaces ( MIntArray & faceList)
MStatus getConnectedEdges ( MIntArray & edgeList )
MStatus getConnectedVertices ( MIntArray & vertexList )
MStatus numConnectedFaces (int &faceCount ) const
MStatus numConnectedEdges (int &edgeCount ) const
bool connectedToFace ( int faceIndex, MStatus * ReturnStatus = NULL)
bool connectedToEdge ( int edgeIndex, MStatus * ReturnStatus = NULL)
MStatus getOppositeVertex ( int &vertexId, int edgeId)
bool onBoundary ( MStatus * ReturnStatus = NULL )
bool hasColor ( MStatus * ReturnStatus = NULL ) const
bool hasColor (int faceIndex, MStatus * ReturnStatus = NULL ) const
MStatus getColor ( MColor &color, int faceIndex, const MString *colorSetName = NULL) const
MStatus getColor ( MColor &color, const MString *colorSetName = NULL) const
MStatus getColors ( MColorArray &colors, const MString *colorSetName = NULL) const
MStatus getColorIndices ( MIntArray &colorIndex, const MString *colorSetName = NULL ) const

Documentation

Iterate of polygonal vertices
Description

This class is the iterator for polygonal vertices.

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 vertices for the polygon. When a component is given this iterator will iterate over the vertices specified in the component. When iterating over components a DAG path to the surface must also be supplied.

Functions

MItMeshVertex:: MItMeshVertex ( MObject & polyObject, MStatus * ReturnStatus )

Description

Constructor.
Creates an iterator for all vertices 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.

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

Description

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

Arguments

  • polyObject The surface to iterate over
  • component The vertices of the polyObject to iterate over
  • ReturnStatus Status code

Status Codes

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

MItMeshVertex:: ~MItMeshVertex ()

Description

Destructor.
Frees up storage used by the iterator.

bool MItMeshVertex:: isDone ( MStatus * ReturnStatus )

Description

Indicates if all of the vertices have been traversed yet.

Arguments

  • ReturnStatus Status code

Return Value

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

Status Codes

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

MStatus MItMeshVertex:: next ()

Description

Advance to the next vertex in the iteration.

Return Value

  • Status code

Status Codes

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

MStatus MItMeshVertex:: reset ()

Description

Reset the iterator to the first vertex.

Return Value

  • Status code

Status Codes

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

MStatus MItMeshVertex:: reset ( MObject & polyObject )

Description

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

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 MItMeshVertex:: geomChanged ()

Description

Reset the geom pointer in the MItMeshVertex. If you're using MFnMesh to update Normals or Color per vertex while iterating, you must call geomChanged on the iteratior immadiately after the MFnMesh call to make sure that your geometry is up to date. A crash may result if this method is not called.

Arguments

Return Value

  • Status code

Status Codes

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

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

Description

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

Arguments

  • polyObject The surface to iterate over
  • component The vertices 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.

int MItMeshVertex:: count ( MStatus * ReturnStatus )

Description

Return the number of vertices in the iteration.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of vertices in the iteration

Status Codes

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

int MItMeshVertex:: index ( MStatus * ReturnStatus )

Description

Returns the index of the current vertex in the vertex list for this polygonal object.
Polygonal objects contain a list of vertices. Faces and edges are specified as indicies from this list, in this way vertices can be shared amoung faces and edges.

Arguments

  • ReturnStatus Status code

Return Value

  • The index in the vertex list for the current vertex

Status Codes

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

MObject MItMeshVertex:: vertex ( MStatus * ReturnStatus )

Description

This method is OBSOLETE, please use the currentItem method.

Get the current vertex in the iteration as a component.

Components are used to specify one or more vertices and are usefull in operating on groups of non-contiguous vertices 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 vertex in the interation

Status Codes

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

MObject MItMeshVertex:: currentItem ( MStatus * ReturnStatus )

Description

Get the current vertex in the iteration as a component.

Components are used to specify one or more vertices and are usefull in operating on groups of non-contiguous vertices 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 vertex in the interation

Status Codes

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

MPoint MItMeshVertex:: position ( MSpace::Space space, MStatus * ReturnStatus )

Description

Return the position of the current vertex in the specified space.
Object space ignores all transformations for the polygon, world space includes all such transformations.

Arguments

  • space The transformation space
  • ReturnStatus Status code

Return Value

  • The postion of the vertex in the specified space

Status Codes

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

MStatus MItMeshVertex:: setPosition ( const MPoint & point, MSpace::Space space )

Description

Set the position of the current vertex in the given space.

Arguments

  • point The new position for the current vertex
  • space 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 MItMeshVertex:: translateBy ( const MVector & vector, MSpace::Space space )

Description

Translate the current vertex by the amount specified by the given vector.

Arguments

  • vector The amount of translation
  • 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 MItMeshVertex:: getNormal ( MVector & vector, MSpace::Space space )

Description

Return the normal or averaged normal if unshared of the current vertex.

Arguments

  • vector 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 MItMeshVertex:: getNormal ( MVector & vector, int faceIndex, MSpace::Space space )

Description

Return the normal of the current vertex in the specified face

Arguments

  • vector Storage for the normal
  • faceIndex face index to get normal for
  • 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 MItMeshVertex:: getNormals ( MVectorArray & normalArray, MSpace::Space space )

Description

Return the normals of the current vertex for all faces

Arguments

  • vectors 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 MItMeshVertex:: getNormalIndices ( MIntArray & normalIndices ) const

Description

This method returns the normal indices of the face/vertex associated with the current vertex.

Arguments

  • normalIndex Normal index filled in this function.

Return Value

  • Status code

Status Codes

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

*

MStatus MItMeshVertex:: numUVs ( int & uvCount, const MString *uvSet )

Description

This method returns the number of unique UVs mapped on this vertex

Arguments

  • uvCount Storage for the UV count
  • uvSet Name of the 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 MItMeshVertex:: setUV ( float2 & uvPoint, const MString * uvSet)

Description

Set the shared UV value at this vertex

Arguments

  • uvPoint Storage for the UV point
  • uvSet Name of the 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 MItMeshVertex:: getUV ( float2 & uvPoint, const MString * uvSet)

Description

Get the shared UV value at this vertex

Arguments

  • uvPoint Storage for the UV point
  • uvSet Name of the 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 MItMeshVertex:: setUV ( int faceId,float2 & uvPoint, const MString *uvSet )

Description

Set the UV value for the given face at the current vertex

Arguments

  • faceId Index of required face
  • uvPoint Value of the UV point
  • uvSet Name of the 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.

MStatus MItMeshVertex:: getUV ( int faceId, float2 & uvPoint, const MString * uvSet ) const

Description

Get the UV value for the give facen at the current vertex

Arguments

  • faceId Index of the required face
  • uvPoint Storage for the UV point
  • uvSet Name of the 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.

MStatus MItMeshVertex:: setUVs ( MFloatArray & uArray, MFloatArray & vArray, MIntArray & faceIds, const MString *uvSet)

Description

Set the UV value for the specified faces at the current vertex. If the face is not already mapped, the value will not be set. If at least ne face was previously mapped, the method should succeed. If no faces were mapped, the method will fail.

Arguments

  • uArray All the U values - in local face order
  • vArray The corresponding V values
  • faceArray The corresponding face Ids
  • uvSet Name of the 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 MItMeshVertex:: getUVs ( MFloatArray & uArray, MFloatArray & vArray, MIntArray & faceIds, const MString *uvSet ) const

Description

Get the UV values for all mapped faces at the current vertex. If at least one face was mapped the method will succeed.

Arguments

  • uArray Storage for all the U values - in local face order
  • vArray Storage for all the corresponding V values
  • faceArray The corresponding face Ids
  • uvSet Name of the 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 MItMeshVertex:: getUVIndices ( MIntArray & uvIndices, const MString * uvSet) const

Description

This method returns the uv indices into the normal array see MFnMesh::getUVs() of the current vertex.

Arguments

  • uvIndices UV index filled in this function.
  • uvSet Name of the uv set.

Return Value

  • Status code

Status Codes

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

*

MStatus MItMeshVertex:: 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 MItMeshVertex:: setIndex ( int index , int &prevIndex)

Description

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

Arguments

  • index The index of the desired vertex to access.
  • ReturnStatus Status code

Return Value

  • The index of the vertex that was previously current

Status Codes

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

MStatus MItMeshVertex:: getConnectedFaces ( MIntArray & faces )

Description

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

Arguments

  • faces An array to stuff all the face indices into
  • ReturnStatus Status code

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 MItMeshVertex:: getConnectedEdges ( MIntArray & edges )

Description

This method gets the indices of the edges connected to the current vertex.

Arguments

  • edges An array to stuff 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 MItMeshVertex:: getConnectedVertices ( MIntArray & vertices)

Description

This method gets the indices of the vertices surrounding the current vertex

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.

MStatus MItMeshVertex:: 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 MItMeshVertex:: numConnectedEdges ( int & edgeCount ) const

Description

This Method checks for the number of connected Edges on this vertex

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 MItMeshVertex:: connectedToFace ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given face contains the current vertex

Arguments

  • status Status code

Return Value

  • TRUE if contained, FALSE otherwise

Status Codes

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

bool MItMeshVertex:: connectedToEdge ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given edge contains the current vertex

Arguments

  • status Status code

Return Value

  • TRUE if contained, FALSE otherwise

Status Codes

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

MStatus MItMeshVertex:: getOppositeVertex ( int &vertexId, int edgeId )

Description

This gets the other vertex of the given edge

Arguments

  • vertexId Storage for the vertex id
  • index The edge to get the other vertex for

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 MItMeshVertex:: onBoundary ( MStatus * ReturnStatus)

Description

This method determines whether the current vertex is on a Boundary

Arguments

  • status Status code

Return Value

  • TRUE if contained, FALSE otherwise

Status Codes

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

bool MItMeshVertex:: hasColor ( MStatus * ReturnStatus) const

Description

This method determines whether the current Vertex has a color set for one or more faces.

Arguments

  • status Status code

Return Value

  • TRUE if a color is set for at least one face, FALSE otherwise

Status Codes

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

bool MItMeshVertex:: hasColor ( int index , MStatus * ReturnStatus) const

Description

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

Arguments

  • status Status code

Return Value

  • TRUE if a color has been set, FALSE otherwise

Status Codes

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

MStatus MItMeshVertex:: getColor ( MColor &color, int faceIndex, const MString *colorSetName) const

Description

This method gets the color of the current vertex in the specified face

Arguments

  • color Place the color here
  • faceIndex The face to get the color for this vertex for
  • 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 MItMeshVertex:: getColor ( MColor &color, const MString *colorSetName) const

Description

This method gets the average color of the vertex

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 MItMeshVertex:: getColors ( MColorArray &colors, const MString *colorSetName) const

Description

This method gets the colors of the current vertex for each face it belongs to. If no colors are assigned to the vertex at all, the return values will be (-1 -1 -1 1). If some but not all of the vertex/face colors have been explicitly set, the ones that have not been set will be (0, 0, 0, 1).

Arguments

  • colors Space for the colors
  • 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 MItMeshVertex:: getColorIndices ( MIntArray &colorIndices, const MString *colorSetName ) const

Description

This method returns the colorIndices into the color array see MFnMesh::getColors() of the current vertex.

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.

*

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright