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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MPxVertexBufferGenerator Class Reference
OpenMayaRender - API module for rendering | Proxy classes

This reference page is linked to from the following overview topics: Autodesk Maya 2014, Extension for Autodesk Maya 2013, Autodesk Maya 2013, 4.3 Customizing Geometric Data for Shaders.

Search for all occurrences

## Detailed Description

Base class for user defined vertex buffer generators.

Implementations of MPxVertexBufferGenerator must be registered with Maya through MDrawRegistry.

MPxVertexGenerators are registered with a unique buffer name. The name signifies the name of the custom stream the generator can produce. When an MPxShaderOverride or custom renderer uses an effect with custom input streams they can provide a unique name in the MVertexBufferDescriptor and a registered MPxVertexBufferGenerator will be used to produce the custom stream for a given shape using the incoming requirements held in the MVertexBuffer.

createVertexStream() is called to allow the generator to fill in the missing vertex data Access the requirements for the requested stream through vertexBuffer.descriptor(). Populate the stream using vertexBuffer.acquire() and vertexBuffer.commit().

`#include <MPxVertexBufferGenerator.h>`

List of all members.

## Public Member Functions
| MPxVertexBufferGenerator ()
| Construct an MPxVertexBufferGenerator.
virtual | ~MPxVertexBufferGenerator ()
| Destructor.
virtual bool | getSourceIndexing (const MObject &object, MComponentDataIndexing &sourceIndexing) const =0
| This function is called to allow the vertex buffer generator to provide its vertex indexing information as well as the space the vertices are in.
virtual bool | getSourceStreams (const MObject &object, MStringArray &sourceStreams) const =0
| This function is called to allow the vertex buffer generator to provide the list of stream names that it requires.
virtual void | createVertexStream (const MObject &object, MVertexBuffer &vertexBuffer, const MComponentDataIndexing &targetIndexing, const MComponentDataIndexing &sharedIndexing, const MVertexBufferArray &sourceStreams) const =0
| This method gets called to allow the generator to fill in the data for a custom vertex stream.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

bool getSourceIndexing | ( | const MObject & | object,
|  | MComponentDataIndexing & | sourceIndexing
| ) |  | const`[pure virtual]`

Search for all occurrences

This function is called to allow the vertex buffer generator to provide its vertex indexing information as well as the space the vertices are in.

The indexing and the component type are stored in the sourceIndexing argument. This indexing information is to allow the system to identify any potential vertex sharing that is common across all vertex requirements.

Parameters:

  [in] | object | The object being evaluated.
  [out] | sourceIndexing | Vertex index mapping in the declared MComponentDataIndexing::MComponentType space.

bool getSourceStreams | ( | const MObject & | object,
|  | MStringArray & | sourceStreams
| ) |  | const`[pure virtual]`

Search for all occurrences

This function is called to allow the vertex buffer generator to provide the list of stream names that it requires.

The names will be used to fill the array of vertex buffers that will be passed to createVertexStream.

Parameters:

  [in] | object | The dag object being evaluated.
  [out] | sourceStreams | Array of strings.

void createVertexStream | ( | const MObject & | object,
|  | MVertexBuffer & | vertexBuffer,
|  | const MComponentDataIndexing & | targetIndexing,
|  | const MComponentDataIndexing & | sharedIndexing,
|  | const MVertexBufferArray & | sourceStreams
| ) |  | const`[pure virtual]`

Search for all occurrences

This method gets called to allow the generator to fill in the data for a custom vertex stream.

Use the requirements in the vertexBuffer to get the description of the stream. Use vertexBuffer.acquire() and vertexBuffer.commit() to fill the buffer.

Parameters:

  [in] | object | The dag object being evaluated.
  [in,out] | vertexBuffer | The vertex buffer to fill.
  [in] | targetIndexing | Vertex index mapping from targetIndexing.getComponentType() space to vertex buffer space.
  [in] | sharedIndexing | Vertex index mapping in the declared MComponentDataIndexing::MComponentType space.
  [in] | sourceStreams | Array of Vertex Buffers that can be used to create the new stream.

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

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator
MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator MPxVertexBufferGenerator