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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

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

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

Search for all occurrences

## Detailed Description

Base class for user defined primitive generators.

Implementations of MPxPrimitiveGenerator must be registered with Maya through MDrawRegistry.

MPxPrimitiveGenerators are registered with a unique primitive type name. The name signifies the name of the custom primitive the generator can produce. When an MPxShaderOverride or custom renderer uses an effect with custom input primitive they can provide a MIndexBufferDescriptor with the desired custom primitive name. A registered MPxPrimitiveGenerator will be used to produce the custom primitive.

`#include <MPxPrimitiveGenerator.h>`

List of all members.

## Public Member Functions
| MPxPrimitiveGenerator ()
| Construct a MPxPrimitiveGenerator.
virtual | ~MPxPrimitiveGenerator ()
| Destructor.
virtual unsigned int | computeIndexCount (const MObject &object, const MObject &component) const =0
| This function is called to allow the primitive generator to provide the number of vertices it will use.
virtual MGeometry::Primitive | generateIndexing (const MObject &object, const MObject &component, const MComponentDataIndexingList &sourceIndexing, const MComponentDataIndexingList &targetIndexing, MIndexBuffer &indexBuffer, int &primitiveStride) const =0
| This method gets called to allow the generator to fill in the data for a custom index stream.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

unsigned int computeIndexCount | ( | const MObject & | object,
|  | const MObject & | component
| ) |  | const`[pure virtual]`

Search for all occurrences

This function is called to allow the primitive generator to provide the number of vertices it will use.

Parameters:

  [in] | object | The object being evaluated.
  [in] | component | The components to use.

MGeometry::Primitive generateIndexing | ( | const MObject & | object,
|  | const MObject & | component,
|  | const MComponentDataIndexingList & | sourceIndexing,
|  | const MComponentDataIndexingList & | targetIndexing,
|  | MIndexBuffer & | indexBuffer,
|  | int & | primitiveStride
| ) |  | const`[pure virtual]`

Search for all occurrences

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

Parameters:

  [in] | object | The object being evaluated.
  [in] | component | The components to use when building the index buffer.
  [in] | sourceIndexing | Vertex index mapping in the declared MComponentDataIndexing::MComponentType space.
  [in] | targetIndexing | Vertex index mapping from targetIndexing.getComponentType() space to vertex buffer space.
  [out] | indexBuffer | The index buffer to fill.
  [out] | primitiveStride | The stride of the generated indexing, only valid when the returned primitive type is kPatch.

Returns:
  The type of primitive of the generated indexing.

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

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator
MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator MPxPrimitiveGenerator