#include <MDrawRegistry.h>
Access the registry associating node types with custom implementations.
This class provides a means to register custom implementations to be used by Viewport 2.0.
Custom draw overrides : Used by Viewport 2.0 to draw dependency nodes. The registry is based on classification strings. Each draw override must be registered with a classification string and any node type with a matching classification string will be drawn using the registered draw override.
Custom stream buffer generators/mutators : Used by Viewport 2.0 to generate custom streams. The registry is based on identification name. Each generator/mutator must be registered with a identification name and any stream with a matching name will be filled using the registered generator or altered using the registered mutator.
Custom index buffer generators/mutators : Used by Viewport 2.0 to generate custom index buffers. The registry is based on primitive type. Each generator/mutator must be registered with a primitive type and any index buffer with a matching type will be filled using the registered generator or altered using the registered mutator.
Custom selection component converters : Used by Viewport 2.0 to perform custom component selection. The registry is based on identification name. Each convert must be registered with a identification name and any render item with a matching name will be processed by the converter during a viewport 2.0 selection.
Static Public Member Functions | |
static MStatus | registerShadingNodeOverrideCreator (const MString &drawClassification, const MString ®istrantId, ShadingNodeOverrideCreator creator) |
Register an implementation of MPxShadingNodeOverride to use with nodes that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterShadingNodeOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxShadingNodeOverride. More... | |
static MStatus | registerSurfaceShadingNodeOverrideCreator (const MString &drawClassification, const MString ®istrantId, SurfaceShadingNodeOverrideCreator creator) |
Register an implementation of MPxSurfaceShadingNodeOverride to use with surface shaders that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterSurfaceShadingNodeOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxSurfaceShadingNodeOverride. More... | |
static MStatus | registerShaderOverrideCreator (const MString &drawClassification, const MString ®istrantId, ShaderOverrideCreator creator) |
Register an implementation of MPxShaderOverride to use with nodes that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterShaderOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxShaderOverride. More... | |
static MStatus | registerGeometryOverrideCreator (const MString &drawClassification, const MString ®istrantId, GeometryOverrideCreator creator) |
Register an implementation of MPxGeometryOverride to use with nodes that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterGeometryOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxGeometryOverride. More... | |
static MStatus | registerDrawOverrideCreator (const MString &drawClassification, const MString ®istrantId, DrawOverrideCreator creator) |
Register an implementation of MPxDrawOverride to use with DAG objects that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterDrawOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxDrawOverride. More... | |
static MStatus | registerSubSceneOverrideCreator (const MString &drawClassification, const MString ®istrantId, SubSceneOverrideCreator creator) |
Register an implementation of MPxSubSceneOverride to use with DAG objects that have the specified, draw-specific classification string. More... | |
static MStatus | deregisterSubSceneOverrideCreator (const MString &drawClassification, const MString ®istrantId) |
Deregister an implementation of MPxSubSceneOverride. More... | |
static MStatus | registerVertexBufferGenerator (const MString &bufferName, VertexBufferGeneratorCreator creator) |
Register an implementation of MPxVertexBufferGenerator to provide custom vertex streams for shapes. More... | |
static MStatus | deregisterVertexBufferGenerator (const MString &bufferName) |
Deregister an implementation of MPxVertexBufferGenerator. More... | |
static MStatus | registerVertexBufferMutator (const MString &bufferName, VertexBufferMutatorCreator creator) |
Register an implementation of MPxVertexBufferMutator to provide custom vertex streams for shapes. More... | |
static MStatus | deregisterVertexBufferMutator (const MString &bufferName) |
Deregister an implementation of MPxVertexBufferMutator. More... | |
static MStatus | registerPrimitiveGenerator (const MString &primitiveType, PrimitiveGeneratorCreator creator) |
Register an implementation of MPxPrimitiveGenerator to generate custom primitive types for shapes. More... | |
static MStatus | deregisterPrimitiveGenerator (const MString &primitiveType) |
Deregister an implementation of MPxPrimitiveGenerator. More... | |
static MStatus | registerIndexBufferMutator (const MString &primitiveType, IndexBufferMutatorCreator creator) |
Register an implementation of MPxIndexBufferMutator to generate custom primitive types for shapes. More... | |
static MStatus | deregisterIndexBufferMutator (const MString &primitiveType) |
Deregister an implementation of MPxIndexBufferMutator. More... | |
static MStatus | registerComponentConverter (const MString &renderItemName, ComponentConverterCreator creator) |
Register an implementation of MPxComponentConverter to use with render items that have the specified name. More... | |
static MStatus | deregisterComponentConverter (const MString &renderItemName) |
Deregister a previously registered MPxComponentConverter for given render item name. More... | |
static const char * | className () |
Returns the name of this class. More... | |
|
static |
Register an implementation of MPxShadingNodeOverride to use with nodes that have the specified, draw-specific classification string.
For each shading node in the scene, the closest matching registered override will be used to create a shading fragment which will be joined to other fragments in the same shader graph. These fragments will eventually be turned into a complete shading effect.
For example, say the following overrides are registered under the given classification strings:
myShadingNodeOverride - "drawdb/shaders/myLibrary/myShader" myLibraryOverride - "drawdb/shaders/myLibrary"
Then all shaders with classification string "drawdb/shaders/myLibrary/myShader" will be evaluated by myShadingNodeOverride while a shader with the classification string "drawdb/shaders/myLibrary/myShinyShader" would be evaluated by myLibraryOverride.
Note that for Viewport 2.0 to recognize a node as a shading node, it must have a classification string beginning with "drawdb/shader".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates the override |
|
static |
Deregister an implementation of MPxShadingNodeOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxSurfaceShadingNodeOverride to use with surface shaders that have the specified, draw-specific classification string.
For each surface shading node in the scene, the closest matching registered override will be used to create a shading fragment which will be joined to other fragments in the same shader graph. These fragments will eventually be turned into a complete shading effect. This type of override should only be used with shading nodes that can be connected to Maya shading engines.
For example, say the following overrides are registered under the given classification strings:
myShadingNodeOverride - "drawdb/shaders/myLibrary/myShader" myLibraryOverride - "drawdb/shaders/myLibrary"
Then all shaders with classification string "drawdb/shaders/myLibrary/myShader" will be evaluated by myShadingNodeOverride while a shader with the classification string "drawdb/shaders/myLibrary/myShinyShader" would be evaluated by myLibraryOverride.
Note that for Viewport 2.0 to recognize a node as a surface shading node, it must have a classification string beginning with "drawdb/shader/surface".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates the override |
|
static |
Deregister an implementation of MPxSurfaceShadingNodeOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxShaderOverride to use with nodes that have the specified, draw-specific classification string.
For each shading node in the scene, the closest matching registered override will be used to create a shading effect for drawing in the viewport.
For example, say the following overrides are registered under the given classification strings:
myShaderOverride - "drawdb/shaders/myLibrary/myShader" myLibraryOverride - "drawdb/shaders/myLibrary"
Then all shaders with classification string "drawdb/shaders/myLibrary/myShader" will be evaluated by myShaderOverride while a shader with the classification string "drawdb/shaders/myLibrary/myShinyShader" would be evaluated by myLibraryOverride.
Note that for Viewport 2.0 to recognize a node as a shading node, it must have a classification string beginning with "drawdb/shader".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates the override |
|
static |
Deregister an implementation of MPxShaderOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxGeometryOverride to use with nodes that have the specified, draw-specific classification string.
For each DAG object in the scene, the closest matching registered override will be used to generate geometry for drawing that object in Viewport 2.0.
For example, say the following overrides are registered under the given classification strings:
myShapeOverride - "drawdb/geometry/myLibrary/myShape" myLibraryOverride - "drawdb/geometry/myLibrary"
Then all DAG objects with classification string "drawdb/geometry/myLibrary/myShape" will have draw geometry generated through myShapeOverride while DAG objects with the classification string "drawdb/geometry/myLibrary/myPointyShape" will have draw geometry generated through myLibraryOverride.
Note that for Viewport 2.0 to recognize a DAG object as a piece of drawable geometry, it must have a classification string beginning with "drawdb/geometry".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates an instance of the override class |
|
static |
Deregister an implementation of MPxGeometryOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxDrawOverride to use with DAG objects that have the specified, draw-specific classification string.
For each DAG object in the scene whose classification string is satisfied by the registered classification string, the draw() method of the given MPxDrawOverride implementation will be called to draw the object in Viewport 2.0.
For example, say the following overrides are registered under the given classification strings:
myShapeDrawOverride - "drawdb/geometry/myLibrary/myShape" myLibraryDrawOverride - "drawdb/geometry/myLibrary"
Then all DAG objects with classification string "drawdb/geometry/myLibrary/myShape" will be drawn through myShapeDrawOverride while DAG objects with the classification string "drawdb/geometry/myLibrary/myPointyShape" would be drawn through myLibraryDrawOverride.
Note that for Viewport 2.0 to recognize a DAG object as a piece of drawable geometry, it must have a classification string beginning with "drawdb/geometry".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates an instance of the draw override class |
|
static |
Deregister an implementation of MPxDrawOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxSubSceneOverride to use with DAG objects that have the specified, draw-specific classification string.
For each DAG object in the scene whose classification string is satisfied by the registered classification string, an instance of the registered MPxSubSceneOverride implementation will be used to display the object in Viewport 2.0.
For example, say the following overrides are registered under the given classification strings:
myShapeSubSceneOverride - "drawdb/subscene/myLibrary/myShape" myLibrarySubSceneOverride - "drawdb/subscene/myLibrary"
Then all DAG objects with classification string "drawdb/subscene/myLibrary/myShape" will be drawn through myShapeSubSceneOverride while DAG objects with the classification string "drawdb/subscene/myLibrary/myPointyShape" would be drawn through myLibrarySubSceneOverride.
Note that for Viewport 2.0 to recognize a DAG object as a drawable sub-scene object, it must have a classification string beginning with "drawdb/subscene".
If multiple implementations are registered for the same classification, the most recently registered will be used. It is an error to try to register multiple implementations for the same classification using the same registrant id.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration |
[in] | creator | Pointer to a function that creates an instance of the draw override class |
|
static |
Deregister an implementation of MPxSubSceneOverride.
[in] | drawClassification | The draw-specific classification string |
[in] | registrantId | Unique name to identify registration, must match the name used to register the override. |
|
static |
Register an implementation of MPxVertexBufferGenerator to provide custom vertex streams for shapes.
These vertex streams are opaque to the system so a registry is used to add buffer generators to the system. The bufferName is used to match the Name in a MVertexBufferDescriptor. A static creator function is supplied to initialize the generator.
[in] | bufferName | Unique name to identify the custom stream this generator can produce. |
[in] | creator | A static function pointer used to create a new instance of the generator. |
Deregister an implementation of MPxVertexBufferGenerator.
[in] | bufferName | Unique name to identify the custom stream this generator can produce. |
|
static |
Register an implementation of MPxVertexBufferMutator to provide custom vertex streams for shapes.
These vertex streams are opaque to the system so a registry is used to add buffer mutators to the system. The bufferName is used to match the Name in a MVertexBufferDescriptor. A static creator function is supplied to initialize the mutator. While the MPxVertexBufferGenerator will allow plugins to CREATE vertex buffers, the MPxVertexBufferMutator will allow plugins to MODIFY the content of vertex buffers created by the application. For example it can be used to swizzle a position vertex stream (change x, y, z to z, y, x) or to swap the U & V coordinates.
[in] | bufferName | Unique name to identify the custom stream this mutator can produce. |
[in] | creator | A static function pointer used to create a new instance of the mutator. |
Deregister an implementation of MPxVertexBufferMutator.
[in] | bufferName | Unique name to identify the custom stream this mutator can produce. |
|
static |
Register an implementation of MPxPrimitiveGenerator to generate custom primitive types for shapes.
These primitives are opaque to the system so a registry is used to add primitive generator to the system.
The primitiveType is used to match the required primitive type reported by a shader override. A static creator function is supplied to initialize the provider.
[in] | primitiveType | Unique name to identify the custom primitive type this generator can produce. |
[in] | creator | A static function pointer used to create a new instance of the generator. |
Deregister an implementation of MPxPrimitiveGenerator.
[in] | primitiveType | Unique name to identify the custom primitive type this generator can produce. |
|
static |
Register an implementation of MPxIndexBufferMutator to generate custom primitive types for shapes.
These mutators are opaque to the system so a registry is used to add them to the system.
The primitiveType is used to match the required primitive type reported by a shader override. A static creator function is supplied to initialize the provider.
[in] | primitiveType | Unique name to identify the custom primitive type this mutator can produce. |
[in] | creator | A static function pointer used to create a new instance of the mutator. |
Deregister an implementation of MPxIndexBufferMutator.
[in] | primitiveType | Unique name to identify the custom primitive type this mutator can produce. |
|
static |
Register an implementation of MPxComponentConverter to use with render items that have the specified name.
When viewport 2.0 selection hits a render item, the registered converter will be called to perform the proper component selection.
[in] | renderItemName | The render item name use as identifier |
[in] | creator | A static function pointer used to create a new instance of the converter. |
Deregister a previously registered MPxComponentConverter for given render item name.
[in] | renderItemName | The render item name use as identifier |
|
static |
Returns the name of this class.