3ds Max USD API Reference
Loading...
Searching...
No Matches
MaxUsdShadingModeRegistry Class Reference

#include <ShadingModeRegistry.h>

Inheritance diagram for MaxUsdShadingModeRegistry:

Classes

struct  ConversionInfo
 All the information registered for a specific material conversion. More...
 

Public Member Functions

MaxUSDAPI bool RegisterExporter (const std::string &name, std::string niceName, std::string description, MaxUsdShadingModeExporterCreator fn)
 
MaxUSDAPI void RegisterExportConversion (const TfToken &materialConversion, const TfToken &renderContext, const TfToken &niceName, const TfToken &description)
 

Static Public Member Functions

static MaxUsdShadingModeExporterCreator GetExporter (const TfToken &name)
 
static TfTokenVector ListExporters ()
 
static const std::string & GetExporterNiceName (const TfToken &name)
 Gets the nice name of an exporter. Used for the UI label of the export options.
 
static const std::string & GetExporterDescription (const TfToken &name)
 Gets the description of an exporter. Used for the popup help of the export options.
 
static MaxUSDAPI MaxUsdShadingModeRegistryGetInstance ()
 
static TfTokenVector ListMaterialConversions ()
 Get all registered export conversions:
 
static const ConversionInfoGetMaterialConversionInfo (const TfToken &materialConversion)
 Gets the conversion information associated with materialConversion on export and import.
 

Friends

class TfSingleton< MaxUsdShadingModeRegistry >
 

Detailed Description

This class provide macros that are entry points into the shading import/export logic.

We understand that shading may want to be imported/exported in many ways across studios. Even within a studio, different workflows may call for different shading modes. The useRegistry exporters and importers can be specialized to support material conversions. The most well known is the default conversion to UsdPreviewSurface shaders. This registry allows introducing other material conversions as necessary to support other renderers. We also allow specifying that an import path is available for these renderers if support has been implemented.

To register a material conversion on export, you need to use the REGISTER_SHADING_MODE_EXPORT_MATERIAL_CONVERSION macro for each material conversion supported by the library. Multiple registration is supported, so each plugin should declare once the material conversions it supports.

In order for the core system to discover the plugin, you need a plugInfo.json that declares the plugin exposes shading modes:

{
"Plugins": [
{
"Info": {
"MaxUsd": {
"ShadingModePlugin" : {}
}
},
"Name": "myUsdPlugin",
"LibraryPath": "../myUsdPlugin.dll",
"Type": "library"
}
]
}

The plugin at LibraryPath will be loaded via the regular USD plugin loading mechanism.

Member Function Documentation

◆ RegisterExportConversion()

MaxUSDAPI void MaxUsdShadingModeRegistry::RegisterExportConversion ( const TfToken &  materialConversion,
const TfToken &  renderContext,
const TfToken &  niceName,
const TfToken &  description 
)

Registers an export material conversion with render context, nice name, and description.

The materialConversion name gets used directly in the render option string as one of the "Materials export to" options of the USD export dialog.

The renderContext gets used to specialize the binding point. See UsdShadeMaterial documentation for details. Use a value of "UsdShadeTokens->universalRenderContext" if the resulting UsdShade nodes are written using an API shared by multiple renderers, like UsdPreviewSurface. For UsdShade nodes targeting a specific rendering engine, please define a custom render context understood by the renderer.

The niceName is the name displayed in the "Materials export to" option of the USD export dialog

The description gets displayed as a tooltip in the "Materials export to" option of the USD export dialog.


The documentation for this class was generated from the following file: