11#include "MaxUsd/MaxUSDAPI.h"
12#include <MaxUsd/Translators/ShadingModeExporter.h>
14#include <pxr/base/tf/registryManager.h>
15#include <pxr/base/tf/singleton.h>
16#include <pxr/base/tf/staticTokens.h>
17#include <pxr/base/tf/token.h>
18#include <pxr/base/tf/weakBase.h>
23PXR_NAMESPACE_OPEN_SCOPE
30#define PXR_MAXUSD_SHADINGMODE_TOKENS \
35TF_DECLARE_PUBLIC_TOKENS(
36 MaxUsdShadingModeTokens,
38 PXR_MAXUSD_SHADINGMODE_TOKENS);
45#define PXR_MAXUSD_SHADINGCONVERSION_TOKENS \
50TF_DECLARE_PUBLIC_TOKENS(
51 MaxUsdPreferredMaterialTokens,
53 PXR_MAXUSD_SHADINGCONVERSION_TOKENS);
98 static MaxUsdShadingModeExporterCreator GetExporter(
const TfToken& name)
100 return GetInstance()._GetExporter(name);
102 static TfTokenVector ListExporters() {
return GetInstance()._ListExporters(); }
107 return GetInstance()._GetExporterNiceName(name);
113 return GetInstance()._GetExporterDescription(name);
120 bool RegisterExporter(
121 const std::string& name,
122 std::string niceName,
123 std::string description,
124 MaxUsdShadingModeExporterCreator fn);
131 return GetInstance()._ListMaterialConversions();
137 TfToken renderContext;
139 TfToken exportDescription;
140 bool hasExporter =
false;
146 , exportDescription(ed)
155 return GetInstance()._GetMaterialConversionInfo(materialConversion);
174 const TfToken& materialConversion,
175 const TfToken& renderContext,
176 const TfToken& niceName,
177 const TfToken& description);
181 MaxUsdShadingModeExporterCreator _GetExporter(
const TfToken& name);
182 MaxUSDAPI
const std::string& _GetExporterNiceName(
const TfToken&);
183 MaxUSDAPI
const std::string& _GetExporterDescription(
const TfToken&);
185 MaxUSDAPI TfTokenVector _ListExporters();
187 MaxUSDAPI TfTokenVector _ListMaterialConversions();
188 MaxUSDAPI
const ConversionInfo& _GetMaterialConversionInfo(
const TfToken&);
195#define REGISTER_SHADING_MODE_EXPORT_MATERIAL_CONVERSION( \
196 name, renderContext, niceName, description) \
197 TF_REGISTRY_FUNCTION(MaxUsdShadingModeExportContext) \
199 MaxUsdShadingModeRegistry::GetInstance().RegisterExportConversion( \
200 name, renderContext, niceName, description); \
203PXR_NAMESPACE_CLOSE_SCOPE
Definition: ShadingModeRegistry.h:96
static const ConversionInfo & GetMaterialConversionInfo(const TfToken &materialConversion)
Gets the conversion information associated with materialConversion on export and import.
Definition: ShadingModeRegistry.h:153
static TfTokenVector ListMaterialConversions()
Get all registered export conversions:
Definition: ShadingModeRegistry.h:129
MaxUSDAPI void RegisterExportConversion(const TfToken &materialConversion, const TfToken &renderContext, const TfToken &niceName, const TfToken &description)
static const std::string & GetExporterDescription(const TfToken &name)
Gets the description of an exporter. Used for the popup help of the export options.
Definition: ShadingModeRegistry.h:111
static const std::string & GetExporterNiceName(const TfToken &name)
Gets the nice name of an exporter. Used for the UI label of the export options.
Definition: ShadingModeRegistry.h:105
All the information registered for a specific material conversion.
Definition: ShadingModeRegistry.h:136