Registration

The attachment model for DG nodes or DAG objects is supported by the registration interface MDrawRegistry. The attachment model for render loop overrides is discussed in greater detail in the section: 3.6 Render Loop Overrides.

For draw, shader, shading node, geometry and sub-scene overrides, the association is implicitly provided via the use of node classification strings. Override classification and Maya node/object classification matching forms this implicit link. The matching is performed hierarchically from broad to specific via the usage of “sub-classifications.”

The format required of a classification string is as follows:

drawdb/<object classification>/[<sub-classification>]/<override classification>”

Figure 35: For each override type the classification matches any objects or nodes specified in the classification.

Figure 36: Example demonstrating that, depending on how on how specific the classification is, different matches results. The “drawdb/geometry/parametricSurface/B-spline” DAG object classification matches more closely to the override with the identical classification string, rather than the more generic “drawdb/geometry/parametricSurface” string. The classification with the closest match is used.

The getClassification command documentation contains a list of classifications recognized by Viewport 2.0.

Registering Display Filters

New display filter types can be added for plug-in objects via a registration interface. If the classification string used matches the classification string used for registering a draw override, the override may be filtered out when visibility checking is performed. The UI name for the filter appears as an option for display filter interfaces for 3d viewports and batch rendering.

MFnPlugin::registerDisplayFilter() is the interface to register a new display filter type. The gpuCache SDK plug-in contains code which demonstrates its usage.