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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MItMeshFaceVertex Class Reference

# OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

Face vertex iterator.

This class is the iterator for face vertices on polygonal surfaces.

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 specified in the component. When iterating over components a DAG path to the surface must also be supplied.

`#include <MItMeshFaceVertex.h>`

List of all members.

## Public Member Functions
| MItMeshFaceVertex (const MObject &polyObject, MStatus *ReturnStatus=NULL)
| Constructor.
| MItMeshFaceVertex (const MDagPath &polyObject, MObject &component=MObject::kNullObj, MStatus *ReturnStatus=NULL)
| Constructor.
virtual | ~MItMeshFaceVertex ()
| Destructor.
bool | isDone (MStatus *ReturnStatus=NULL)
| Indicates if all of the face vertices have been traversed.
MStatus | next ()
| Advance to the next face vertext in the iteration.
MStatus | reset ()
| Reset the iterator to the first face vertex.
MStatus | reset (const MObject &polyObject)
| Reset the iterator to the first polygon in the supplied surface.
MStatus | reset (const MDagPath &polyObject, MObject &component=MObject::kNullObj)
| Reset the iterator with the given surface and component.
int | vertId (MStatus *ReturnStatus=NULL) const
| Returns the index of the current face vertex.
int | faceId (MStatus *ReturnStatus=NULL) const
| Returns the current face index.
int | faceVertId (MStatus *ReturnStatus=NULL) const
| Returns the relative index of the vertex within the current face.
MObject | faceVertex (MStatus *ReturnStatus=NULL) const
| This method is obsolete.
MObject | currentItem (MStatus *ReturnStatus=NULL) const
| Returns the double componet index of the vertex and face.
MPoint | position (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL)
| Return the position of the current face vertex.
MStatus | getNormal (MVector &normal, MSpace::Space space=MSpace::kObject) const
| Return the face vertex normal.
int | normalId (MStatus *ReturnStatus=NULL) const
| Returns the normal index for the specified vertex.
int | tangentId (MStatus *ReturnStatus=NULL) const
| Returns the tangent (or binormal) index for the specified vertex.
MVector | getTangent (MSpace::Space space=MSpace::kObject, const MString *uvSet=NULL, MStatus *ReturnStatus=NULL) const
| Return the face vertex tangent associated with the given UV set.
MVector | getBinormal (MSpace::Space space=MSpace::kObject, const MString *uvSet=NULL, MStatus *ReturnStatus=NULL) const
| Return the face vertex binormal associated with the UV set.
bool | hasUVs (MStatus *ReturnStatus=NULL) const
| Does this face vertex has UV's mapped or not.
bool | hasUVs (const MString &uvSet, MStatus *ReturnStatus=NULL) const
| Does this face vertex has UV's mapped or not in a given uv set.
MStatus | getUV (float2 &uvPoint, const MString *uvSet=NULL) const
| Return the texture coordinate for the current face vertex.
MStatus | getUVIndex (int &index, const MString *uvSet=NULL)
| Returns the index of the texture coordinate for the current face vertex.
MStatus | getUVIndex (int &index, float &u, float &v, const MString *uvSet=NULL)
| Return the index of the texture coordinate for the current face vertex.
bool | hasColor (MStatus *ReturnStatus=NULL) const
| This method determines whether the current face vertex has color-per-vertex set.
MStatus | getColor (MColor &color, const MString *colorSetName=NULL)
| Return a color of the current face vertex.
MStatus | getColorIndex (int &colorIndex, const MString *colorSetName=NULL)
| Return a color index of the current face vertex.
MStatus | updateSurface ()
| Signal that this polygonal surface has changed and needs to redraw itself.
MStatus | geomChanged ()
| Reset the geom pointer in the MItMeshFaceVertex.
MStatus | setIndex (int faceId, int vertFaceId, int &prevFaceId, int &prevVertId)
| This method sets the index of the current face vertex to be accessed.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MItMeshFaceVertex | ( | const MObject & | polyObject,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Creates an iterator for all face vertices of the given surface.

Parameters:

  [in] | polyObject | The surface to iterate over
  [out] | ReturnStatus | Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MItMeshFaceVertex | ( | const MDagPath & | polyObject,
|  | MObject & | component = `MObject::kNullObj`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | polyObject | The surface to iterate over
  [in] | component | The polygons of the polyObject to iterate over
  [out] | ReturnStatus | Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

~MItMeshFaceVertex | ( |  | ) | `[virtual]`

Destructor.

Frees up storage used by the iterator.

## Member Function Documentation

bool isDone | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Indicates if all of the face vertices have been traversed.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  Boolean value: true All face vertices have been traversed, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus next | ( |  | ) |

Search for all occurrences

Advance to the next face vertext in the iteration.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus reset | ( |  | ) |

Search for all occurrences

Reset the iterator to the first face vertex.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus reset | ( | const MObject & | polyObject | ) |

Search for all occurrences

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

Parameters:

  [in] | polyObject | The polygonal object for the iteration

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus reset | ( | const MDagPath & | polyObject,
|  | MObject & | component = `MObject::kNullObj`
| ) |  |

Search for all occurrences

Reset the iterator with the given surface and component.

If component is null then the iteration will be for all face vertices in the given surface.

Parameters:

  [in] | polyObject | The surface to iterate over
  [in] | component | The polygons of the polyObject to iterate over

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

int vertId | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the index of the current face vertex.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The index of the current face vertex.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

int faceId | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the current face index.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The index of the current face.

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

int faceVertId | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the relative index of the vertex within the current face.

This index together with the faceId can be used for a fast access to get various info stored per vertex (normals, uvs, colors).

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The relative index of the current vertex.

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

MObject faceVertex | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

This method is obsolete.

Deprecated:
  Use the MItMeshFaceVertex::currentItem method.

Returns the double componet index of the vertex and face.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  An MObject containing the double index.

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

MObject currentItem | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the double componet index of the vertex and face.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  An MObject containing the double index.

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

MPoint position | ( | MSpace::Space | space = `MSpace::kObject`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Return the position of the current face vertex.

Parameters:

  [in] | space | The coordinate system for this operation
  [out] | ReturnStatus | Status code

Returns:
  The vertex position

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus getNormal | ( | MVector & | normal,
|  | MSpace::Space | space = `MSpace::kObject`
| ) |  | const

Search for all occurrences

Return the face vertex normal.

Parameters:

  [out] | normal | Storage for the normal
  [in] | space | The transformation space

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

int normalId | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The index of the normal for the current vertex

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

int tangentId | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The index of the tangnet for the current vertex

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MVector getTangent | ( | MSpace::Space | space = `MSpace::kObject`,
|  | const MString * | uvSet = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Return the face vertex tangent associated with the given UV set.

The tangent is defined as the surface tangent of the polygon running in the U direction.

Parameters:

  [in] | space | The transformation space.
  [in] | uvSet | The name of the uv set.
  [out] | ReturnStatus |

Returns:
  The normalized tangent vector. A null vector will be returned if the tangent can't be found.

MVector getBinormal | ( | MSpace::Space | space = `MSpace::kObject`,
|  | const MString * | uvSet = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Return the face vertex binormal associated with the UV set.

Parameters:

  [in] | space | The transformation space
  [in] | uvSet | The name of the associated UV set.
  [out] | ReturnStatus |

Returns:
  The normalized binormal vector. A null vector will be returned if the tangent can't be found.

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

Search for all occurrences

Does this face vertex has UV's mapped or not.

Parameters:

  [in] | ReturnStatus | Status Code

Returns:
  Boolean value: true if the face vertex has UV's mapped, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool hasUVs | ( | const MString & | uvSet,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Does this face vertex has UV's mapped or not in a given uv set.

Parameters:

  [in] | uvSet | UV set to work with
  [in] | ReturnStatus | Status Code

Returns:
  Boolean value: true if the face vertex has UV's mapped, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus getUV | ( | float2 & | uvPoint,
|  | const MString * | uvSet = `NULL`
| ) |  | const

Search for all occurrences

Return the texture coordinate for the current face vertex.

Parameters:

  [out] | uvPoint | Storage for u and v values
  [in] | uvSet | UV set to work with

Returns:
  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();

MStatus getUVIndex | ( | int & | index,
|  | const MString * | uvSet = `NULL`
| ) |  |

Search for all occurrences

Returns the index of the texture coordinate for the current face vertex.

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

Parameters:

  [out] | index | Storage for the texture coordinate index of the current face vertex
  [in] | uvSet | UV set to work with

Returns:
  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();

MStatus getUVIndex | ( | int & | index,
|  | float & | u,
|  | float & | v,
|  | const MString * | uvSet = `NULL`
| ) |  |

Search for all occurrences

Return the index of the texture coordinate for the current face vertex.

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

Parameters:

  [out] | index | Storage for the texture coordinate index of the specified vertex
  [out] | u | Storage for u value
  [out] | v | Storage for v value
  [in] | uvSet | UV set to work with

Returns:
  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();

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

Search for all occurrences

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

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  Boolean 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.

MStatus getColor | ( | MColor & | color,
|  | const MString * | colorSetName = `NULL`
| ) |  |

Search for all occurrences

Return a color of the current face vertex.

Parameters:

  [out] | color | Current face vertex color
  [in] | colorSetName | Name of the color set.

Returns:
  Status code

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

MStatus getColorIndex | ( | int & | colorIndex,
|  | const MString * | colorSetName = `NULL`
| ) |  |

Search for all occurrences

Return a color index of the current face vertex.

Parameters:

  [out] | colorIndex | Storage for the color index
  [in] | colorSetName | Name of the color set.

Returns:
  Status code

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

MStatus updateSurface | ( |  | ) |

Search for all occurrences

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

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus geomChanged | ( |  | ) |

Search for all occurrences

Reset the geom pointer in the MItMeshFaceVertex.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setIndex | ( | int | faceIndex,
|  | int | faceVertIndex,
|  | int & | prevFaceId,
|  | int & | prevVertId
| ) |  |

Search for all occurrences

This method sets the index of the current face vertex to be accessed.

The current face vertex will no longer be in sync with any previous iteration.

Parameters:

  [in] | faceIndex | Index of desired face to access.
  [in] | faceVertIndex | Face-relative index of desired vertex to access.
  [out] | prevFaceId | Index of the face which was current before the change.
  [out] | prevVertId | Face-relative index of the vertex which was current before the change.

Returns:
  Status code

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

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex
MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex MItMeshFaceVertex