- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

# Mesh Class Reference

This reference page is linked to from the following overview topics: Mudbox 2013, Scene Graph, Mesh and Topology, Mesh Division, Picking, Sculpting and Brushes.

Search for all occurrences

## Detailed Description

A Mesh is a collection of vertices organized into faces, and optional Texture Coordinate information.

Mudbox models are represented by objects of the class Geometry. Each Geometry object contains a list of Meshes, one for each subdivision level. Each mesh is either entirely triangles, or entirely quads.

Examples:

  CurveBrush/CurveCreator.h, FixedFunctionMaterial/FixedFunctionMaterial.h, ImmediateModeRenderer/ImmediateModeRenderer.h, MeshBuilder/MeshBuilder.cpp, MeshBuilder/MeshBuilder.h, PLYImport/Importer.cpp, PtexExtractor/PtexLayout.h, PtexExtractor/PtexPaintExporter.h, PtexExtractor/PtexUtilizer.h, PtexImporter/PtexImporter.cpp, PtexImporter/PtexImporter.h, and ToonMaterial/ToonMaterial.h.

Definition at line 260 of file mesh.h.

`#include <mesh.h>`

Inheritance diagram for Mesh:
[legend]

List of all members.

## Public Member Functions
virtual class Geometry * | Geometry (void) const
| Returns a pointer to the Geometry object that this mesh belongs to.
virtual class MeshRenderer * | Renderer (float fLODLevel=1.0f)
| Returns a pointer to a MeshRenderer with the desired level-of-detail (see MeshRenderer for more information)
virtual void | CopyTo (Node *pNode) const
| Copy the content of this mesh to another one.
virtual class Material * | Material (void) const
| Returns a pointer to the Material associated with this mesh.
virtual class Material * | MaterialOverride (void) const
| Material override.
unsigned int | VertexCount (void) const
| Returns the number of vertices in the mesh.
void | SetVertexCount (unsigned int iVertexCount)
| Sets the number of vertices in the mesh. Any existing data (that fits) will be kept.
unsigned int | TCCount (void) const
| Returns the number of texture coordinates in the mesh.
virtual void | SetTCCount (unsigned int iTCCount)
| Sets the number of texture coordinate vertices in the mesh.
bool | HasTC (void) const
| Returns true if the mesh has texture coordinates.
virtual unsigned int | UVlessPaintingStatus (void) const
| Return the status of UV-less setup. 0 means no uv-less setup, 1 means the mesh is being set up, 2 means the mesh is uv-less setup.
virtual void | SetUVlessPaintingStatus (unsigned int iStatus)
| Setup the status of UV-less setup.
const Vertex * | VertexArray (void) const
| This method returns a pointer to the actual array data.
const Vertex & | VertexData (unsigned int iVertexIndex) const
| Returns a vertex.
Vertex & | VertexData (unsigned int iVertexIndex)
| Returns a vertex.
const Vector & | VertexPosition (unsigned int iVertexIndex) const
| Returns the x,y,z position of the vertex with the given index.
Vector & | VertexPosition (unsigned int iVertexIndex)
| Returns the x,y,z position of the vertex with the given index.
virtual const Vector & | VertexOriginalPosition (unsigned int iVertexIndex) const
| Returns the position of the vertex before the current sculpting-brush stroke.
const TC & | VertexTC (unsigned int iVertexTCIndex) const
| Returns the specified texture coordinate.
Vector | VertexNormal (unsigned int iVertexIndex) const
| Returns the normal of the vertex with the given index.
unsigned int | VertexStrokeID (unsigned int iVertexIndex) const
| Internal use only. Do not call this method.
float | VertexMask (unsigned int iVertexIndex) const
| Returns the layer mask of the vertex with the given index for the current sculpt layer.
float | VertexFreeze (unsigned int iVertexIndex) const
| Returns the freeze value of the vertex with the given index.
virtual unsigned int | FrozenVertexCount (void) const
| Returns the number of vertices having a non-zero freeze value.
const tnormal * | VertexNormalArray (unsigned int iVertexIndex) const
| Returns the normal of the vertex with the given index as an array of 16-bit signed values.
tnormalv | VertexNormalValue (unsigned int iVertexIndex) const
| Returns the normal of the vertex with the given index as a single 64-bit signed value.
const Normal * | VertexNormalArray (void) const
unsigned int | VertexNormalCount (void) const
virtual AxisAlignedBoundingBox | BoundingBox (bool bRecalculate=false) const
| Returns the bounding box of the mesh in local space.
virtual AxisAlignedBoundingBox | TCBoundingBox (void) const
| Returns the bounding box of the UV shell of the mesh.
void | SetVertexPosition (unsigned int iVertexIndex, const Vector &vPosition)
| Sets the position of the vertex with the given index.
void | AddVertexPosition (unsigned int iVertexIndex, const Vector &vPosition)
| Adds vPosition to the current position of the vertex with the given index.
void | SetVertexNormal (unsigned int iVertexIndex, int *pNormal)
| Internal use only. Do not call.
void | SetVertexNormal (unsigned int iVertexIndex, const Vector &vNormal)
| Sets the normal of the vertex with the given index.
void | SetVertexTC (unsigned int iTCIndex, const TC &tc)
| Sets the Texture Coordinated(UV) value at the given index.
virtual void | SetVertexFreeze (unsigned int iVertexIndex, unsigned int iFaceIndex, float fFreeze)
| Sets the freeze value for the vertex with the given index.
virtual void | SetFreezeValues (Store< float > &aNewFreeze)
| Sets the freeze values for the whole mesh from the given array.
void | SetVertexMask (unsigned int iVertexIndex, unsigned int iFaceIndex, float fFMask)
| Internal use only. Do not call.
void | SetVertexStrokeID (unsigned int iVertexIndex, unsigned int iStrokeID) const
| Internal use only. Do not call.
virtual void | MarkVertex (unsigned int iVertexIndex)
| Mark a particular vertex.
virtual bool | IsVertexMarked (unsigned int iVertexIndex)
| Returns true if a particular vertex is marked.
virtual void | ClearVertexMarks (void)
| Clears all vertex marks.
virtual unsigned int | VertexExternalIndex (unsigned int iVertexIndex) const
| Returns the external vertex index for a given vertex.
virtual void | SetVertexExternalIndex (unsigned int iVertexIndex, unsigned int iExternalVertexIndex)
| Sets the external vertex index for a given internal vertex index in the Mudbox mesh.
const Vector & | TriangleVertexPosition (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the position of a corner of a mesh face.
const Vector & | QuadVertexPosition (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the position of a corner of a mesh face. Can be used for quadric meshes only.
const TC & | TriangleVertexTC (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the texture coordinates of a corner of a mesh face.
const TC & | QuadVertexTC (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the texture coordinates of a corner of a mesh face. Can be used for quadric meshes only.
Vector | TriangleVertexNormal (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.
Vector | QuadVertexNormal (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a mesh face. Can be used for quad meshes only.
Vector | TriangleVertexCreaseNormal (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.
Vector | QuadVertexCreaseNormal (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a mesh face. Can be used for quad meshes only.
float | TriangleVertexFreeze (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the freeze value of a corner of a mesh face. Can be used for triangular meshes only.
float | QuadVertexFreeze (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the freeze value of a corner of a mesh face.
const tnormal * | TriangleVertexNormalArray (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a triangle mesh face as an array of 16-bit signed values.
const tnormal * | QuadVertexNormalArray (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the normal of a corner of a quad mesh face as an array of 16-bit signed values.
tnormalv | TriangleVertexNormalValue (unsigned int iTriangleIndex, unsigned int iCornerIndex) const
| Returns the normal a corner of a triangle mesh face as a single 64-bit signed value.
tnormalv | QuadVertexNormalValue (unsigned int iQuadIndex, unsigned int iCornerIndex) const
| Returns the normal a corner of a quad mesh face as a single 64-bit signed value.
virtual void | EnumerateFaces (unsigned int iFaceIndex, FaceEnumerator *pEnumerator, bool bSymmetry=false)
| This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its neighbors, then the neighbors of those faces, until the mesh has been covered.
virtual void | EnumerateNearestFaces (unsigned int iFaceIndex, FaceEnumerator *pOperation)
| This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its immediate neighbours.
virtual void | EnumerateVertices (unsigned int iFaceIndex, VertexEnumerator *pEnumerator)
| This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices of the specified face.
unsigned int | EnumerateAdjacentVertices (AdjacentVertexEnumerator *pEnumerator, unsigned int iVertexIndex, unsigned int iFaceIndex)
| This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices adjacent to the specified one.
virtual int | MeshVersion (void) const
| Obsolete method; do not use.
virtual void | SmoothTextureCoordinates (float fStrength)
| Obsolete method; do not use.
virtual void | RecalculateNormals (bool bKeep=false)
| Recalculates all the vertex normals. This is called after the mesh shape has changed.
virtual void | RecalculateAdjacency (bool bForce=true)
| Causes the mesh to build internal adjacency tables, if they don't exist already.
virtual unsigned int | CollectionID (void) const
| Obsolete method; do not use.
virtual void | IncreaseCollectionID (void)
| Obsolete method; do not use.
virtual bool | IsSelected (void)
| Returns true if the whole mesh is selected.
virtual void | SetSelected (bool bOn=true)
| Selects or unselects the whole mesh.
virtual class LayerMeshData * | AddLayer (Layer *pLayer=NULL)
| Add a sculpt layer for this mesh, and makes it current.
virtual void | RemoveLayer (LayerMeshData *pLayer)
| Removes a sculpt layer from the mesh and deletes it.
virtual class LayerMeshData * | ActiveLayer (void) const
| Returns a pointer to the current sculpt layer for this mesh.
virtual bool | IsActiveLevel (void) const
| Returns true if this mesh is the currently displayed mesh of the Geometry object it is part of.
virtual bool | Lock (class MeshUnlocker *pUnlocker=NULL)
| Locks the mesh for exclusive modifications.
virtual bool | Unlock (void)
| Unlock the mesh.
virtual bool | IsLocked (void)
| Returns true if the mesh is locked.
class MeshChange * | StartChange (void)
| This method must be called by any plugin before it modifies vertex data.
virtual bool | IsNSided (void) const
| Returns if the mesh contains non tri or quad faces.
virtual GenericFace & | Face (unsigned int iIndex)
| Returns a polygon from generic face representation of the mesh.
virtual unsigned int | GenericFaceCount (void)
| Returns the number of original faces.
virtual bool | HasExpandedTCs (void) const
| Returns if the mesh has edge bleeded TC layout.
virtual void | CreateExpandedTCs (void)
| Calculates the edge bleeded TC layout.
virtual TC & | ExpandedTC (unsigned int index)
| Returns the Expanded TC value for the given vertex.
virtual bool | SupportsTangentMirror () const
| Returns if the mesh supports tangent mirror mode.
virtual unsigned int | TangentMirroredFaceIndex (unsigned int iFaceIndex) const
| Returns the index of tangent mirrored face.
virtual unsigned int | TangentMirroredVertexIndex (unsigned int iFaceIndex, unsigned int iCornerIndex, unsigned int &iOppositeFaceIndex, unsigned int &iOppositeCornerIndex) const
| Returns the index of tangent mirrored vertex.
virtual bool | InitializeTopologicalSymmetry (unsigned int iFaceIndex0, unsigned int iFaceIndex1)
| This function initializes the topological symmetry for the mesh.
virtual bool | IsTopologicalSymmetryInitialized (unsigned int &iFaceIndex0, unsigned int &iFaceIndex1) const
| This function returns true if topological symmetry is initialized properly for the mesh.
virtual void | RecalculateTopologicalSymmetry (void)
| This function recalculates topological symmetry information from the lower subdivision levels if has any.
virtual unsigned int | PrimaryCount (bool bNeedToUseTC)
virtual unsigned int | QuadPrimaryIndex (bool bNeedToUseTC, unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the primary index of a corner of a quad.
virtual unsigned int | TrianglePrimaryIndex (bool bNeedToUseTC, unsigned int iFaceIndex, unsigned int iCornerIndex)
| Returns the primary index of a corner of a triangle.
virtual void | Transform (const Matrix &mMatrix)
virtual void | CheckValidity (DiagnosticLevel iLevel=dgnLevel2) const
| See the documentation for Node::CheckValidity.
## Public Attributes
aptr< LayerMeshData > | ActiveSculptLayer
| This is a readonly pointer containing the address of the active sculpt layer or null if there is no active layer.
Store< TC > | m_pTCs
aevent | Modified
| This event is triggered when the mesh has been editer. During a sculpt stroke this event is only triggered once at the end.
## Protected Member Functions
| Mesh (FaceType eFaceType=typeQuadric)
| Constructor.
## Protected Attributes
Store< Vertex > | m_pVertices
unsigned int | m_iVertexCount
Store< Normal > | m_pVertexNormals

## Constructor & Destructor Documentation

Mesh | ( | FaceType | eFaceType = `typeQuadric` | ) | `[protected]`

Constructor.

Do not use directly.

Instead of constructing Meshes directly, you should use CreateInstance() like this:

            Mesh *myNewMesh = CreateInstance<Mesh>();

Parameters:

  [in] | eFaceType | Must be one of Topology::typeQuadric or Topology::typeTriangular

## Member Function Documentation

virtual class Geometry* Geometry | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns a pointer to the Geometry object that this mesh belongs to.

Reimplemented in SubdivisionLevel.

Examples:
  PtexImporter/PtexImporter.cpp.

virtual class MeshRenderer* Renderer | ( | float | fLODLevel = `1.0f` | ) | `[virtual]`

Search for all occurrences

Returns a pointer to a MeshRenderer with the desired level-of-detail (see MeshRenderer for more information)

Parameters:

  [in] | fLODLevel | the desired level-of-detail

virtual void CopyTo | ( | Node * | pNode | ) | const `[virtual]`

Search for all occurrences

Copy the content of this mesh to another one.

Reimplemented from Topology.

virtual class Material* Material | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns a pointer to the Material associated with this mesh.

virtual class Material* MaterialOverride | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Material override.

Allows user to set an alternate material to render to do temporary rendering (e.g. selection)

unsigned int VertexCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the number of vertices in the mesh.

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 298 of file mesh.h.

    { return m_iVertexCount; };

void SetVertexCount | ( | unsigned int | iVertexCount | ) |

Search for all occurrences

Sets the number of vertices in the mesh. Any existing data (that fits) will be kept.

Parameters:

  [in] | iVertexCount | the number of vertices that should be in the mesh

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

unsigned int TCCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns the number of texture coordinates in the mesh.

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 306 of file mesh.h.

    { return m_pTCs.ItemCount(); };

virtual void SetTCCount | ( | unsigned int | iTCCount | ) | `[virtual]`

Search for all occurrences

Sets the number of texture coordinate vertices in the mesh.

Parameters:

  [in] | iTCCount | the number of texture coordinate vertices in the mesh

Examples:
  MeshBuilder/MeshBuilder.cpp.

bool HasTC | ( | void |  | ) | const `[inline]`

Search for all occurrences

Returns true if the mesh has texture coordinates.

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 314 of file mesh.h.

    { return (FaceComponents() & fcTCIndex) != 0 && TCCount() > 0; };

virtual unsigned int UVlessPaintingStatus | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Return the status of UV-less setup. 0 means no uv-less setup, 1 means the mesh is being set up, 2 means the mesh is uv-less setup.

virtual void SetUVlessPaintingStatus | ( | unsigned int | iStatus | ) | `[virtual]`

Search for all occurrences

Setup the status of UV-less setup.

Parameters:

  [in] | iStatus | status value ranging from 0 to 2. 0 means no uv-less setup, 1 means the mesh is being set up, 2 means the mesh is uv-less setup.

const Vertex* VertexArray | ( | void |  | ) | const `[inline]`

Search for all occurrences

This method returns a pointer to the actual array data.

This is used in cases where very fast access to the array data is required (i.e. not going through methods)

Definition at line 329 of file mesh.h.

    { return &m_pVertices[0]; };

const Vertex& VertexData | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns a vertex.

Parameters:

  [in] | iVertexIndex | index of the vertex to be retrieved

Definition at line 332 of file mesh.h.

                    { return m_pVertices[iVertexIndex]; };

Vertex& VertexData | ( | unsigned int | iVertexIndex | ) | `[inline]`

Search for all occurrences

Returns a vertex.

Parameters:

  [in] | iVertexIndex | index of the vertex to be retrieved

Definition at line 337 of file mesh.h.

              { return m_pVertices[iVertexIndex]; };

const Vector& VertexPosition | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the x,y,z position of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 342 of file mesh.h.

                    { return m_pVertices[iVertexIndex].m_vPos; };

Vector& VertexPosition | ( | unsigned int | iVertexIndex | ) | `[inline]`

Search for all occurrences

Returns the x,y,z position of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 347 of file mesh.h.

              { return m_pVertices[iVertexIndex].m_vPos; };

virtual const Vector& VertexOriginalPosition | ( | unsigned int | iVertexIndex | ) | const `[inline, virtual]`

Search for all occurrences

Returns the position of the vertex before the current sculpting-brush stroke.

If no stroke is in progress, result is the same as VertexPosition().

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 354 of file mesh.h.

                    { return m_pVertices[iVertexIndex].m_vPos; };

const TC& VertexTC | ( | unsigned int | iVertexTCIndex | ) | const `[inline]`

Search for all occurrences

Returns the specified texture coordinate.

Parameters:

  [in] | iVertexTCIndex | index of the texture coordinate (not the same as a vertex index)

Definition at line 359 of file mesh.h.

                    { return m_pTCs[iVertexTCIndex]; };

Vector VertexNormal | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the normal of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 364 of file mesh.h.

                    { return Vector( m_pVertexNormals[iVertexIndex].m_vNormal ); };

unsigned int VertexStrokeID | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Internal use only. Do not call this method.

Definition at line 369 of file mesh.h.

            { return m_pVertices[iVertexIndex].m_iStrokeID; };

float VertexMask | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the layer mask of the vertex with the given index for the current sculpt layer.

Each sculpt layer contains vertex offsets for some subset of vertices in the mesh. Each vertex in a mesh has a mask value for each sculpt layer associated with it. This mask determines how much the vertex offset of that sculpt layer contributes to the final position of the vertex when all the sculpt layers are composited together. This mask is a multiplier, so 0.0 means the layer offset is completely masked, and 1.0 means it is not masked at all.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 382 of file mesh.h.

                    { return m_pVertices[iVertexIndex].Mask(); };

float VertexFreeze | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the freeze value of the vertex with the given index.

(0.0 is not frozen; 1.0 is completely frozen)

The freeze value is used to lock parts of the mesh so they are less affected by sculpting brushes. It is the responsibility of every sculpt brush to take into account the Freeze values on vertices it is modifying.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 393 of file mesh.h.

                    { return m_pVertices[iVertexIndex].Freeze(); };

virtual unsigned int FrozenVertexCount | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the number of vertices having a non-zero freeze value.

If the result is 0, no part of the mesh is frozen.

const tnormal* VertexNormalArray | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the normal of the vertex with the given index as an array of 16-bit signed values.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 403 of file mesh.h.

                    { return m_pVertexNormals[iVertexIndex].m_vNormal; };

tnormalv VertexNormalValue | ( | unsigned int | iVertexIndex | ) | const `[inline]`

Search for all occurrences

Returns the normal of the vertex with the given index as a single 64-bit signed value.

Parameters:

  [in] | iVertexIndex | index of the vertex

Definition at line 409 of file mesh.h.

                    { return m_pVertexNormals[iVertexIndex].m_iNormal; };

const Normal* VertexNormalArray | ( | void |  | ) | const `[inline]`

Search for all occurrences

Definition at line 413 of file mesh.h.

    { return &m_pVertexNormals[0]; };

unsigned int VertexNormalCount | ( | void |  | ) | const `[inline]`

Search for all occurrences

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 415 of file mesh.h.

    { return m_pVertexNormals.ItemCount(); }

virtual AxisAlignedBoundingBox BoundingBox | ( | bool | bRecalculate = `false` | ) | const `[virtual]`

Search for all occurrences

Returns the bounding box of the mesh in local space.

virtual AxisAlignedBoundingBox TCBoundingBox | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the bounding box of the UV shell of the mesh.

void SetVertexPosition | ( | unsigned int | iVertexIndex,
|  | const Vector & | vPosition
| ) |  | `[inline]`

Search for all occurrences

Sets the position of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex
  [in] | vPosition | the new vertex x,y,z position in local space

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

Definition at line 424 of file mesh.h.

              { m_pVertices[iVertexIndex].m_vPos = vPosition; };

void AddVertexPosition | ( | unsigned int | iVertexIndex,
|  | const Vector & | vPosition
| ) |  | `[inline]`

Search for all occurrences

Adds vPosition to the current position of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex
  [in] | vPosition | x,y,z offset to be added to the current position in local space

Definition at line 430 of file mesh.h.

        { m_pVertices[iVertexIndex].m_vPos += vPosition; };

void SetVertexNormal | ( | unsigned int | iVertexIndex,
|  | int * | pNormal
| ) |  | `[inline]`

Search for all occurrences

Internal use only. Do not call.

Definition at line 437 of file mesh.h.

        {
            m_pVertexNormals[iVertexIndex].m_vNormal[0] = tnormal(pNormal[3]);
            m_pVertexNormals[iVertexIndex].m_vNormal[1] = tnormal(pNormal[2]);
            m_pVertexNormals[iVertexIndex].m_vNormal[2] = tnormal(pNormal[1]);
        };

void SetVertexNormal | ( | unsigned int | iVertexIndex,
|  | const Vector & | vNormal
| ) |  | `[inline]`

Search for all occurrences

Sets the normal of the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex
  [in] | vNormal | the new vertex normal in local space, need to be normalized.

Definition at line 445 of file mesh.h.

            {
                m_pVertexNormals[iVertexIndex].m_vNormal[0] = tnormal(vNormal.x * MB_NORMALMAX);
                m_pVertexNormals[iVertexIndex].m_vNormal[1] = tnormal(vNormal.y * MB_NORMALMAX);
                m_pVertexNormals[iVertexIndex].m_vNormal[2] = tnormal(vNormal.z * MB_NORMALMAX);
            };

void SetVertexTC | ( | unsigned int | iTCIndex,
|  | const TC & | tc
| ) |  | `[inline]`

Search for all occurrences

Sets the Texture Coordinated(UV) value at the given index.

Parameters:

  [in] | iTCIndex | index of the vertex tc
  [in] | tc | the vertex tc value

Examples:
  MeshBuilder/MeshBuilder.cpp.

Definition at line 462 of file mesh.h.

              { m_pTCs[iTCIndex] = tc; }

virtual void SetVertexFreeze | ( | unsigned int | iVertexIndex,
|  | unsigned int | iFaceIndex,
|  | float | fFreeze
| ) |  | `[virtual]`

Search for all occurrences

Sets the freeze value for the vertex with the given index.

Parameters:

  [in] | iVertexIndex | index of the vertex
  | fFreeze | WHY DO WE NEED A FACE INDEX HERE? [in] New freeze value, ranging from 0.0 (not frozen) to 1.0 (completely frozen)

virtual void SetFreezeValues | ( | Store< float > & | aNewFreeze | ) | `[virtual]`

Search for all occurrences

Sets the freeze values for the whole mesh from the given array.

Parameters:

  [in] | aNewFreeze | the array of freeze values

void SetVertexMask | ( | unsigned int | iVertexIndex,
|  | unsigned int | iFaceIndex,
|  | float | fFMask
| ) |  |

Search for all occurrences

Internal use only. Do not call.

void SetVertexStrokeID | ( | unsigned int | iVertexIndex,
|  | unsigned int | iStrokeID
| ) |  | const `[inline]`

Search for all occurrences

Internal use only. Do not call.

Definition at line 484 of file mesh.h.

            { m_pVertices[iVertexIndex].m_iStrokeID = iStrokeID; };

virtual void MarkVertex | ( | unsigned int | iVertexIndex | ) | `[virtual]`

Search for all occurrences

Mark a particular vertex.

This method, along with Mesh::IsVertexMarked() and Mesh::ClearVertexMarks() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete.

Parameters:

  [in] | iVertexIndex | index of the vertex to mark

virtual bool IsVertexMarked | ( | unsigned int | iVertexIndex | ) | `[virtual]`

Search for all occurrences

Returns true if a particular vertex is marked.

This method, along with Mesh::MarkVertex() and Mesh::ClearVertexMarks() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete.

Parameters:

  [in] | iVertexIndex | index of the vertex

virtual void ClearVertexMarks | ( | void |  | ) | `[virtual]`

Search for all occurrences

Clears all vertex marks.

This method, along with Mesh::MarkVertex() and Mesh::IsVertexMarked() is used to aid in traversing all the vertices in a mesh. An algorithm can mark the vertices as it visits them to ensure that it don't visit any twice, and then clear all the marks when complete. This is a very fast function.

virtual unsigned int VertexExternalIndex | ( | unsigned int | iVertexIndex | ) | const `[virtual]`

Search for all occurrences

Returns the external vertex index for a given vertex.

Internally, Mudbox may reorganize the layout of an imported mesh to optimize performance. This can change the vertex indices and make it difficult to re-import newer versions of the same mesh for tasks like importing a mesh as a sculpt layer. This method can be used to determine the original vertex index is for a given internal vertex index in the Mudbox mesh. When exporting meshes from Mudbox or when trying to map vertices from an imported mesh to this mesh's vertices, you should always use the external vertex indices.

Parameters:

  [in] | iVertexIndex | Internal vertex index within the Mesh

virtual void SetVertexExternalIndex | ( | unsigned int | iVertexIndex,
|  | unsigned int | iExternalVertexIndex
| ) |  | `[virtual]`

Search for all occurrences

Sets the external vertex index for a given internal vertex index in the Mudbox mesh.

See VertexExternalIndex()

Parameters:

  [in] | iVertexIndex | Internal vertex index
  [in] | iExternalVertexIndex | The new external vertex index that the internal index should map to.

const Vector& TriangleVertexPosition | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the position of a corner of a mesh face.

Can be used for triangular meshes only.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 538 of file mesh.h.

                    { return VertexPosition( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };

const Vector& QuadVertexPosition | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the position of a corner of a mesh face. Can be used for quadric meshes only.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 544 of file mesh.h.

                    { return VertexPosition( QuadIndex( iQuadIndex, iCornerIndex ) ); };

const TC& TriangleVertexTC | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the texture coordinates of a corner of a mesh face.

Can be used for triangular meshes only.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 551 of file mesh.h.

                    { return VertexTC( TriangleTCI( iTriangleIndex, iCornerIndex ) ); };

const TC& QuadVertexTC | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the texture coordinates of a corner of a mesh face. Can be used for quadric meshes only.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 557 of file mesh.h.

                    { return VertexTC( QuadTCI( iQuadIndex, iCornerIndex ) ); };

Vector TriangleVertexNormal | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 563 of file mesh.h.

                    { return VertexNormal( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };

Vector QuadVertexNormal | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a mesh face. Can be used for quad meshes only.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 569 of file mesh.h.

                    { return VertexNormal( QuadIndex( iQuadIndex, iCornerIndex ) ); };

Vector TriangleVertexCreaseNormal | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 575 of file mesh.h.

                    { return VertexNormal( TriangleCreaseNormalIndex( iTriangleIndex, iCornerIndex ) ); };

Vector QuadVertexCreaseNormal | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a mesh face. Can be used for quad meshes only.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 581 of file mesh.h.

                    { return VertexNormal( QuadCreaseNormalIndex( iQuadIndex, iCornerIndex ) ); };

float TriangleVertexFreeze | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the freeze value of a corner of a mesh face. Can be used for triangular meshes only.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 587 of file mesh.h.

                    { return VertexFreeze( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };

float QuadVertexFreeze | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the freeze value of a corner of a mesh face.

(0.0 is not frozen, 1.0 is completely frozen) Can be used for quadric meshes only.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 594 of file mesh.h.

                    { return VertexFreeze( QuadIndex( iQuadIndex, iCornerIndex ) ); };

const tnormal* TriangleVertexNormalArray | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a triangle mesh face as an array of 16-bit signed values.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 600 of file mesh.h.

                    { return VertexNormalArray( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };

const tnormal* QuadVertexNormalArray | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal of a corner of a quad mesh face as an array of 16-bit signed values.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 606 of file mesh.h.

                    { return VertexNormalArray( QuadIndex( iQuadIndex, iCornerIndex ) ); };

tnormalv TriangleVertexNormalValue | ( | unsigned int | iTriangleIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal a corner of a triangle mesh face as a single 64-bit signed value.

Parameters:

  [in] | iTriangleIndex | index of a triangular face
  [in] | iCornerIndex | index of a corner in that face (0, 1, or 2)

Definition at line 612 of file mesh.h.

                    { return VertexNormalValue( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };

tnormalv QuadVertexNormalValue | ( | unsigned int | iQuadIndex,
|  | unsigned int | iCornerIndex
| ) |  | const `[inline]`

Search for all occurrences

Returns the normal a corner of a quad mesh face as a single 64-bit signed value.

Parameters:

  [in] | iQuadIndex | index of a quad face
  [in] | iCornerIndex | index of a corner of that face (0, 1, 2, or 3)

Definition at line 618 of file mesh.h.

                    { return VertexNormalValue( QuadIndex( iQuadIndex, iCornerIndex ) ); };

virtual void EnumerateFaces | ( | unsigned int | iFaceIndex,
|  | FaceEnumerator * | pEnumerator,
|  | bool | bSymmetry = `false`
| ) |  | `[virtual]`

Search for all occurrences

This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its neighbors, then the neighbors of those faces, until the mesh has been covered.

In normal use, the entire mesh would not be covered. The FaceEnumerator's Tester() function returns false to limit the spread to a particular area. For example, this is used by sculpt operations to touch all the faces inside the brush ring.

See FaceEnumerator for more details.

Parameters:

  [in] | iFaceIndex | the index of the starting face
  [in] | pEnumerator | a pointer to a FaceEnumerator that you define
  [in] | bSymmetry | make the enumerator follow the defined symmetry. This will probably be removed in future; you should set this to false.

virtual void EnumerateNearestFaces | ( | unsigned int | iFaceIndex,
|  | FaceEnumerator * | pOperation
| ) |  | `[virtual]`

Search for all occurrences

This method takes an operation that you define (derived from FaceEnumerator) and applies it to the specified face, and sequentially to its immediate neighbours.

See FaceEnumerator for more details.

Parameters:

  [in] | iFaceIndex | the index of the starting face
  [in] | pOperation | a pointer to a FaceEnumerator that you define

virtual void EnumerateVertices | ( | unsigned int | iFaceIndex,
|  | VertexEnumerator * | pEnumerator
| ) |  | `[virtual]`

Search for all occurrences

This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices of the specified face.

See VertexEnumerator for more details.

Parameters:

  [in] | iFaceIndex | the index of the starting face
  [in] | pEnumerator | a pointer to a VertexEnumerator that you define

unsigned int EnumerateAdjacentVertices | ( | AdjacentVertexEnumerator * | pEnumerator,
|  | unsigned int | iVertexIndex,
|  | unsigned int | iFaceIndex
| ) |  |

Search for all occurrences

This method takes an operation that you define (derived from VertexEnumerator) and applies it to all the vertices adjacent to the specified one.

It returns the number of vertices that were visited.

See VertexEnumerator for more details.

Parameters:

  [in] | pEnumerator | a pointer to a VertexEnumerator that you define
  [in] | iVertexIndex | the index of the starting vertex
  [in] | iFaceIndex | index of any face adjacent to that vertex

virtual int MeshVersion | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Obsolete method; do not use.

virtual void SmoothTextureCoordinates | ( | float | fStrength | ) | `[virtual]`

Search for all occurrences

Obsolete method; do not use.

virtual void RecalculateNormals | ( | bool | bKeep = `false` | ) | `[virtual]`

Search for all occurrences

Recalculates all the vertex normals. This is called after the mesh shape has changed.

Parameters:

  bKeep | Not used

Examples:
  MeshBuilder/MeshBuilder.cpp.

virtual void RecalculateAdjacency | ( | bool | bForce = `true` | ) | `[virtual]`

Search for all occurrences

Causes the mesh to build internal adjacency tables, if they don't exist already.

Parameters:

  [in] | bForce | Force the tables to be re-built, even if they already exist.

Examples:
  MeshBuilder/MeshBuilder.cpp, and PtexImporter/PtexImporter.cpp.

virtual unsigned int CollectionID | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Obsolete method; do not use.

virtual void IncreaseCollectionID | ( | void |  | ) | `[virtual]`

Search for all occurrences

Obsolete method; do not use.

virtual bool IsSelected | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns true if the whole mesh is selected.

virtual void SetSelected | ( | bool | bOn = `true` | ) | `[virtual]`

Search for all occurrences

Selects or unselects the whole mesh.

virtual class LayerMeshData* AddLayer | ( | Layer * | pLayer = `NULL` | ) | `[virtual]`

Search for all occurrences

Add a sculpt layer for this mesh, and makes it current.

A LayerMeshData is created & returned if necessary. If NULL, a new empty layer will be created & returned.

virtual void RemoveLayer | ( | LayerMeshData * | pLayer | ) | `[virtual]`

Search for all occurrences

Removes a sculpt layer from the mesh and deletes it.

Users should not reference pLayer after calling this method.

Parameters:

  [in] | pLayer | The layer to remove.

virtual class LayerMeshData* ActiveLayer | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns a pointer to the current sculpt layer for this mesh.

virtual bool IsActiveLevel | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns true if this mesh is the currently displayed mesh of the Geometry object it is part of.

virtual bool Lock | ( | class MeshUnlocker * | pUnlocker = `NULL` | ) | `[virtual]`

Search for all occurrences

Locks the mesh for exclusive modifications.

The caller of this function will get exclusive rights to modify the data stored in the mesh if the return value is true. In other words, mudbox guarantees that no other code will modify the mesh until it is unlocked. The caller can pass the address of a MeshUnlocker objects, which will be used to determine if the mesh can be unlocked, and can perform actions before the unlock happens.

Parameters:

  [in] | pUnlocker | Address of the unlocker object. If this parameter is NULL, the object can be unlocked any time

virtual bool Unlock | ( | void |  | ) | `[virtual]`

Search for all occurrences

Unlock the mesh.

Returns true if the operation was executed successfully, or if the mesh was unlocked at the time of the call. If the mesh was locked, and a MeshUnlocker object was specified by the Lock call, that MeshUnlocker object will be used to determine if the mesh can be unlocked.

virtual bool IsLocked | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns true if the mesh is locked.

class MeshChange* StartChange | ( | void |  | ) |

Search for all occurrences

This method must be called by any plugin before it modifies vertex data.

It returns a MeshChange object that will hold the needed undo information.

virtual bool IsNSided | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the mesh contains non tri or quad faces.

virtual GenericFace& Face | ( | unsigned int | iIndex | ) | `[virtual]`

Search for all occurrences

Returns a polygon from generic face representation of the mesh.

virtual unsigned int GenericFaceCount | ( | void |  | ) | `[virtual]`

Search for all occurrences

Returns the number of original faces.

virtual bool HasExpandedTCs | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns if the mesh has edge bleeded TC layout.

Can be used instead of the normal TC layot if we want to modify texture without artifact at shell borders.

virtual void CreateExpandedTCs | ( | void |  | ) | `[virtual]`

Search for all occurrences

Calculates the edge bleeded TC layout.

virtual TC& ExpandedTC | ( | unsigned int | index | ) | `[virtual]`

Search for all occurrences

Returns the Expanded TC value for the given vertex.

virtual bool SupportsTangentMirror | ( |  | ) | const `[virtual]`

Search for all occurrences

Returns if the mesh supports tangent mirror mode.

virtual unsigned int TangentMirroredFaceIndex | ( | unsigned int | iFaceIndex | ) | const `[virtual]`

Search for all occurrences

Returns the index of tangent mirrored face.

virtual unsigned int TangentMirroredVertexIndex | ( | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex,
|  | unsigned int & | iOppositeFaceIndex,
|  | unsigned int & | iOppositeCornerIndex
| ) |  | const `[virtual]`

Search for all occurrences

Returns the index of tangent mirrored vertex.

virtual bool InitializeTopologicalSymmetry | ( | unsigned int | iFaceIndex0,
|  | unsigned int | iFaceIndex1
| ) |  | `[virtual]`

Search for all occurrences

This function initializes the topological symmetry for the mesh.

The two specified faces must be adjacent, they define the topological axis.

virtual bool IsTopologicalSymmetryInitialized | ( | unsigned int & | iFaceIndex0,
|  | unsigned int & | iFaceIndex1
| ) |  | const `[virtual]`

Search for all occurrences

This function returns true if topological symmetry is initialized properly for the mesh.

If so, it puts the indices of two adjacent faces into the references.

virtual void RecalculateTopologicalSymmetry | ( | void |  | ) | `[virtual]`

Search for all occurrences

This function recalculates topological symmetry information from the lower subdivision levels if has any.

virtual unsigned int PrimaryCount | ( | bool | bNeedToUseTC | ) | `[virtual]`

Search for all occurrences

virtual unsigned int QuadPrimaryIndex | ( | bool | bNeedToUseTC,
|  | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | `[virtual]`

Search for all occurrences

Returns the primary index of a corner of a quad.

When two vertices has the same primary index, then that means that all the data for the two vertices are the same (including pos, tc, normal). In other words, this index would be used by the renderer when it creates the hardware index buffers.

virtual unsigned int TrianglePrimaryIndex | ( | bool | bNeedToUseTC,
|  | unsigned int | iFaceIndex,
|  | unsigned int | iCornerIndex
| ) |  | `[virtual]`

Search for all occurrences

Returns the primary index of a corner of a triangle.

When two vertices has the same index, then that means that all the data for the two vertices are the same (including pos, tc, normal). In other words, this index would be used by the renderer when it creates the hardware index buffers.

virtual void Transform | ( | const Matrix & | mMatrix | ) | `[virtual]`

Search for all occurrences

virtual void CheckValidity | ( | DiagnosticLevel | iLevel = `dgnLevel2` | ) | const `[virtual]`

Search for all occurrences

See the documentation for Node::CheckValidity.

Reimplemented from Topology.

Reimplemented in SubdivisionLevel.

## Member Data Documentation

aptr<LayerMeshData> ActiveSculptLayer

Search for all occurrences

This is a readonly pointer containing the address of the active sculpt layer or null if there is no active layer.

Plugins can watch this pointer by connecting their own copy to it, and respond to the event when the active layer switches.

Definition at line 715 of file mesh.h.

Store<TC> m_pTCs

Search for all occurrences

Definition at line 770 of file mesh.h.

aevent Modified

Search for all occurrences

This event is triggered when the mesh has been editer. During a sculpt stroke this event is only triggered once at the end.

Definition at line 773 of file mesh.h.

Store<Vertex> m_pVertices `[protected]`

Search for all occurrences

Definition at line 799 of file mesh.h.

unsigned int m_iVertexCount `[protected]`

Search for all occurrences

Definition at line 800 of file mesh.h.

Store<Normal> m_pVertexNormals `[protected]`

Search for all occurrences

Definition at line 801 of file mesh.h.

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

- Mudbox/mesh.h

Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh
Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh Mesh