MPxPrimitiveGenerator Class Reference

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



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 MDagPath &objPath, 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 MDagPath &objPath, 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 MDagPath objPath,
const MObject component 
) const [pure virtual]

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

Parameters:
[in]objPathThe path to the object being evaluated.
[in]componentThe components to use.
MGeometry::Primitive generateIndexing ( const MDagPath objPath,
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.

Parameters:
[in]objPathThe path to the object being evaluated.
[in]componentThe components to use when building the index buffer.
[in]sourceIndexingVertex index mapping in the declared MComponentDataIndexing::MComponentType space.
[in]targetIndexingVertex index mapping from targetIndexing.getComponentType() space to vertex buffer space.
[out]indexBufferThe index buffer to fill.
[out]primitiveStrideThe 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]

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