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

We provide macros that are entry points into the job context logic. More...

#include <JobContextRegistry.h>

Inheritance diagram for MaxUsdJobContextRegistry:

Classes

struct  ContextInfo
 All the information registered for a specific job context. More...
 

Public Types

typedef std::function< VtDictionary()> EnablerFn
 Enabler function, returns a dictionary containing all the options for the context. More...
 

Public Member Functions

MaxUSDAPI void RegisterExportJobContext (const std::string &jobContext, const std::string &niceName, const std::string &description, EnablerFn enablerFct, bool fromPython=false)
 
MaxUSDAPI void RegisterImportJobContext (const std::string &jobContext, const std::string &niceName, const std::string &description, EnablerFn enablerFct, bool fromPython=false)
 

Static Public Member Functions

static TfTokenVector ListJobContexts ()
 Get all registered export job contexts:
 
static const ContextInfoGetJobContextInfo (const TfToken &jobContext)
 Gets the conversion information associated with jobContext on export and import.
 
static MaxUSDAPI MaxUsdJobContextRegistryGetInstance ()
 

Friends

class TfSingleton< MaxUsdJobContextRegistry >
 

Detailed Description

We provide macros that are entry points into the job context logic.

Member Typedef Documentation

◆ EnablerFn

typedef std::function<VtDictionary()> MaxUsdJobContextRegistry::EnablerFn

Enabler function, returns a dictionary containing all the options for the context.

An job context basically wraps a function that tweaks the set of import/export options. This job context has a name and UI components, as well as an enabler function that allows specifying the options dictionary.

To register an export job context, you need to use the REGISTER_EXPORT_JOB_CONTEXT macro for each export job context supported by the library.

In order for the core system to discover the plugin, you need a plugInfo.json that declares job contexts.

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

Member Function Documentation

◆ RegisterExportJobContext()

MaxUSDAPI void MaxUsdJobContextRegistry::RegisterExportJobContext ( const std::string &  jobContext,
const std::string &  niceName,
const std::string &  description,
EnablerFn  enablerFct,
bool  fromPython = false 
)

Registers an export job context, with nice name, description and enabler function.

Parameters
jobContextname will be used directly as one of the valid values of the job context option.
niceNameis the name displayed in the options dialog.
descriptionis displayed as a tooltip in the options dialog.
enablerFctwill be called after option parsing to enable context specific options.

◆ RegisterImportJobContext()

MaxUSDAPI void MaxUsdJobContextRegistry::RegisterImportJobContext ( const std::string &  jobContext,
const std::string &  niceName,
const std::string &  description,
EnablerFn  enablerFct,
bool  fromPython = false 
)

Registers an import job context, with nice name, description and enabler function.

Parameters
jobContextname will be used directly as one of the valid values of the job context option.
niceNameis the name displayed in the options dialog.
descriptionis displayed as a tooltip in the options dialog.
enablerFctwill be called after option parsing to enable context specific options.

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