This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013, 4.3 Customizing Geometric Data for Shaders.
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>
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. | |
| unsigned int computeIndexCount | ( | const MObject & | object, |
| const MObject & | component | ||
| ) | const [pure virtual] |
This function is called to allow the primitive generator to provide the number of vertices it will use.
| [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] |
This method gets called to allow the generator to fill in the data for a custom index stream.
| [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. |
| const char * className | ( | ) | [static] |