class MItMeshFaceVertex

Jump to documentation

Face vertex iterator. (OpenMaya) (OpenMaya.py)

public members:

MItMeshFaceVertex ( const MObject & polyObject, MStatus * ReturnStatus = NULL )
MItMeshFaceVertex ( const MDagPath &polyObject, MObject & component = MObject::kNullObj , MStatus * ReturnStatus = NULL )
virtual ~MItMeshFaceVertex ()
bool isDone ( MStatus * ReturnStatus = NULL )
MStatus next ()
MStatus reset ()
MStatus reset ( const MObject & polyObject )
MStatus reset ( const MDagPath &polyObject, MObject & component = MObject::kNullObj )
int vertId ( MStatus * ReturnStatus = NULL ) const
int faceId ( MStatus * ReturnStatus = NULL ) const
int faceVertId ( MStatus * ReturnStatus = NULL ) const
MObject faceVertex ( MStatus * ReturnStatus = NULL) const
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL) const
MPoint position ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MStatus getNormal ( MVector & normal, MSpace::Space space = MSpace::kObject ) const
Get/Set methods for normals.
int normalId ( MStatus * ReturnStatus = NULL ) const
int tangentId ( MStatus * ReturnStatus = NULL ) const
MVector getTangent ( MSpace::Space space = MSpace::kObject , const MString * uvSet = NULL, MStatus * ReturnStatus = NULL) const
MVector getBinormal ( MSpace::Space space = MSpace::kObject , const MString * uvSet = NULL, MStatus * ReturnStatus = NULL) const
bool hasUVs ( MStatus * ReturnStatus = NULL ) const
bool hasUVs ( const MString & uvSet, MStatus * ReturnStatus = NULL ) const
MStatus getUV ( float2 & uvPoint, const MString * uvSet = NULL) const
MStatus getUVIndex ( int & index, const MString *uvSet = NULL )
MStatus getUVIndex ( int & index, float & u, float & v, const MString *uvSet = NULL)
bool hasColor ( MStatus * ReturnStatus = NULL ) const
MStatus getColor ( MColor &color, const MString *colorSetName = NULL)
MStatus getColorIndex ( int & colorIndex, const MString *colorSetName = NULL )
MStatus updateSurface ()
MStatus geomChanged ()
MStatus setIndex (int faceId , int vertFaceId, int &prevFaceId, int &prevVertId )

Documentation

Iterate over face vertices of polygonal surfaces
Description

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.

Functions

MItMeshFaceVertex:: MItMeshFaceVertex ( const MObject & polyObject, MStatus * ReturnStatus )
Description

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

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

Description

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.

Arguments

  • polyObject The surface 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.

MItMeshFaceVertex:: ~MItMeshFaceVertex ()

Description

Destructor.
Frees up storage used by the iterator.

bool MItMeshFaceVertex:: isDone ( MStatus * ReturnStatus )

Description

Indicates if all of the face vertices have been traversed.

Arguments

  • ReturnStatus Status code

Return Value

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

Status Codes

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

MStatus MItMeshFaceVertex:: next ()

Description

Advance to the next face vertext in the iteration.

Return Value

  • Status code

Status Codes

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

MStatus MItMeshFaceVertex:: reset ()

Description

Reset the iterator to the first face vertex.

Return Value

  • Status code

Status Codes

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

MStatus MItMeshFaceVertex:: reset ( const MObject & polyObject )

Description

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

Arguments

  • polyObject The polygonal object for the iteration

Return Value

  • Status code

Status Codes

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

MStatus MItMeshFaceVertex:: 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 face vertices in the given surface.

Arguments

  • polyObject The surface to iterate over
  • component The polygons 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 MItMeshFaceVertex:: vertId ( MStatus * ReturnStatus ) const

Description

Returns the index of the current face vertex.

Arguments

  • ReturnStatus Status code

Return Value

  • The index of the current face vertex.

Status Codes

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

int MItMeshFaceVertex:: faceId ( MStatus * ReturnStatus ) const

Description

Returns the current face index.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MItMeshFaceVertex:: faceVertId ( MStatus * ReturnStatus ) const

Description

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).

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MItMeshFaceVertex:: faceVertex ( MStatus * ReturnStatus ) const

Description

This method is OBSOLETE, please use the currentItem method.

Returns the double componet index of the vertex and face.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MItMeshFaceVertex:: currentItem ( MStatus * ReturnStatus ) const

Description

Returns the double componet index of the vertex and face.

Arguments

  • ReturnStatus Status code

Return Value

  • 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 MItMeshFaceVertex:: position ( MSpace::Space space, MStatus * ReturnStatus )

Description

Return the position of the current face vertex.

Arguments

  • 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.

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

Description

Return the face vertex normal.

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.

int MItMeshFaceVertex:: normalId ( 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

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

Return Value

  • 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 MItMeshFaceVertex:: tangentId ( 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

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

Return Value

  • 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 MItMeshFaceVertex:: getTangent ( MSpace::Space space, const MString * uvSet, MStatus * ReturnStatus) const

Description

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.

Arguments

  • space The transformation space.
  • uvSet The name of the uv set.
  • ReturnStatus

Return Value

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

MVector MItMeshFaceVertex:: getBinormal ( MSpace::Space space, const MString * uvSet, MStatus * ReturnStatus) const

Description

Return the face vertex binormal associated with the UV set.

Arguments

  • space The transformation space
  • uvSet The name of the associated UV set.
  • ReturnStatus

Return Value

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

bool MItMeshFaceVertex:: hasUVs ( MStatus * ReturnStatus) const

Description

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

Arguments

  • Status code Status Code

Return 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 MItMeshFaceVertex:: hasUVs (const MString &uvSet, MStatus * ReturnStatus) const

Description

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

Arguments

  • uvSet UV set to work with
  • Status code Status Code

Return 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 MItMeshFaceVertex:: getUV ( float2 &uvPoint, const MString *uvSet ) const

Description

Return the texture coordinate for the current face vertex.

Arguments

  • vertex The face-relative vertex index to get UV for
  • uvPoint Storage for u and v values
  • (\bf 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();

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

Description

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.

Arguments

  • index Storage for the texture coordinate index of the current face vertex
  • (\bf 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();

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

Description

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.

Arguments

  • index Storage for the texture coordinate index of the specified vertex
  • u Storage for u value
  • v Storage for v value
  • (\bf 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();

bool MItMeshFaceVertex:: hasColor ( MStatus * ReturnStatus) const

Description

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

Arguments

  • status 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.

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

Description

Return a color of the current face vertex.

Arguments

  • color Current face vertex 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 MItMeshFaceVertex:: getColorIndex ( int &colorIndex, const MString *colorSetName )

Description

Return a color index of the current face vertex.

Arguments

  • colorIndex Storage for the color index
  • colorSetName Storage for the color index

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

Description

Reset the geom pointer in the MItMeshFaceVertex.

Arguments

Return Value

  • Status code

Status Codes

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

MStatus MItMeshFaceVertex:: setIndex ( int faceIndex, int faceVertIndex, int &prevFaceId, int &prevVertId )

Description

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.

Arguments

  • faceIndex The index of desired face to access.
  • vertIndex The relative (local to face) index of desired vertex to access.
  • ReturnStatus Status code

Return Value

  • The index of the current face in the iteration
  • The index of the current face in the iteration

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