MPxPrimitiveGenerator Class Reference

#include <MPxPrimitiveGenerator.h>

Class 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.

+ Examples:

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. More...
 
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. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Member Function Documentation

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.

Parameters
[in]objectThe object being evaluated.
[in]componentThe 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.

Parameters
[in]objectThe 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.

The documentation for this class was generated from the following files:
  • MPxPrimitiveGenerator.h
  • MPxPrimitiveGenerator.cpp