MaterialX 1.38.2
Public Member Functions | Static Public Member Functions | List of all members
Mesh Class Reference

Container for mesh data. More...

#include <Mesh.h>

Public Member Functions

 Mesh (const string &identifier)
 
const string & getIdentifier () const
 Get mesh identifier.
 
void setSourceUri (const string &sourceUri)
 Set the mesh's source URI.
 
bool hasSourceUri () const
 Return true if this mesh has a source URI.
 
const string & getSourceUri () const
 Return the mesh's source URI.
 
MeshStreamPtr getStream (const string &name) const
 Get a mesh stream by name. More...
 
MeshStreamPtr getStream (const string &type, unsigned int index) const
 Get a mesh stream by type and index. More...
 
void addStream (MeshStreamPtr stream)
 Add a mesh stream.
 
void removeStream (MeshStreamPtr stream)
 Remove a mesh stream.
 
void setVertexCount (size_t val)
 Set vertex count.
 
size_t getVertexCount () const
 Get vertex count.
 
void setMinimumBounds (const Vector3 &val)
 Set the minimum bounds for the geometry.
 
const Vector3getMinimumBounds () const
 Return the minimum bounds for the geometry.
 
void setMaximumBounds (const Vector3 &v)
 Set the minimum bounds for the geometry.
 
const Vector3getMaximumBounds () const
 Return the minimum bounds for the geometry.
 
void setSphereCenter (const Vector3 &val)
 Set center of the bounding sphere.
 
const Vector3getSphereCenter () const
 Return center of the bounding sphere.
 
void setSphereRadius (float val)
 Set radius of the bounding sphere.
 
float getSphereRadius () const
 Return radius of the bounding sphere.
 
size_t getPartitionCount () const
 Return the number of mesh partitions.
 
void addPartition (MeshPartitionPtr partition)
 Add a partition.
 
MeshPartitionPtr getPartition (size_t partIndex) const
 Return a reference to a mesh partition.
 
MeshStreamPtr generateNormals (MeshStreamPtr positionStream)
 Generate face normals from the given positions. More...
 
MeshStreamPtr generateTangents (MeshStreamPtr positionStream, MeshStreamPtr normalStream, MeshStreamPtr texcoordStream)
 Generate tangents from the given positions, normals, and texture coordinates. More...
 
void mergePartitions ()
 Merge all mesh partitions into one.
 
void splitByUdims ()
 Split the mesh into a single partition per UDIM.
 

Static Public Member Functions

static MeshPtr create (const string &identifier)
 Create a new mesh.
 

Detailed Description

Container for mesh data.

Member Function Documentation

◆ generateNormals()

MeshStreamPtr generateNormals ( MeshStreamPtr  positionStream)

Generate face normals from the given positions.

Parameters
positionStreamInput position stream
Returns
The generated normal stream

◆ generateTangents()

MeshStreamPtr generateTangents ( MeshStreamPtr  positionStream,
MeshStreamPtr  normalStream,
MeshStreamPtr  texcoordStream 
)

Generate tangents from the given positions, normals, and texture coordinates.

Parameters
positionStreamInput position stream
normalStreamInput normal stream
texcoordStreamInput texcoord stream
Returns
The generated tangent stream, on success; otherwise, a null pointer.

◆ getStream() [1/2]

MeshStreamPtr getStream ( const string &  name) const
inline

Get a mesh stream by name.

Parameters
nameName of stream
Returns
Reference to a mesh stream if found

◆ getStream() [2/2]

MeshStreamPtr getStream ( const string &  type,
unsigned int  index 
) const
inline

Get a mesh stream by type and index.

Parameters
typeType of stream
indexIndex of stream
Returns
Reference to a mesh stream if found

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