3ds Max USD API Reference
Loading...
Searching...
No Matches
MaxUsdPrimWriterRegistry Struct Reference

Provides functionality to register and lookup USD writer plugins for 3dsMax nodes. More...

#include <PrimWriterRegistry.h>

Public Types

typedef std::function< MaxUsdPrimWriterSharedPtr(const MaxUsdWriteJobContext &)> WriterFactoryFn
 

Static Public Member Functions

static MaxUSDAPI void Register (const std::string &key, WriterFactoryFn fn, bool fromPython=false)
 Register a new prim writer via it's factory function. More...
 
static MaxUSDAPI void Unregister (const std::string &key)
 Unregisters a prim writer. More...
 
static MaxUSDAPI std::vector< MaxUsdPrimWriterSharedPtr > GetAllWriters (const MaxUsdWriteJobContext &jobCtx)
 Returns all prim writers for a given write job context. More...
 
static MaxUSDAPI std::vector< MaxUsdPrimWriterSharedPtr > FindWriters (INode *node, const std::vector< MaxUsdPrimWriterSharedPtr > &candidateWriters)
 Returns prim writers which can be used to translate a given object, given from a list of candidate writers. Prioritize ContextSupport::Supported over ContextSupport::Fallback. Other than this, writers are returned in the order they are they are received as candidates. More...
 

Detailed Description

Provides functionality to register and lookup USD writer plugins for 3dsMax nodes.

Use PXR_MAXUSD_REGISTER_WRITER(uniqueName, writerClass) to register a writer class with the registry.

Prim writers derive from the PrimWriter class and are expected to implement several methods to specify what objects they are able to support, and how to actually perform the conversion.

In order for the core system to discover the plugin at export time, you need a plugInfo.json specifying the plugin's type.

{
"Plugins":[
{
"Info":{
"MaxUsd":{
"PrimWriter" : {}
}
},
"Name":"myTranslatorPlugin",
"Type":"library",
"LibraryPath":"myTranslatorPlugin.dll"
}
]
}

Member Function Documentation

◆ FindWriters()

static MaxUSDAPI std::vector< MaxUsdPrimWriterSharedPtr > MaxUsdPrimWriterRegistry::FindWriters ( INode *  node,
const std::vector< MaxUsdPrimWriterSharedPtr > &  candidateWriters 
)
static

Returns prim writers which can be used to translate a given object, given from a list of candidate writers. Prioritize ContextSupport::Supported over ContextSupport::Fallback. Other than this, writers are returned in the order they are they are received as candidates.

Parameters
nodeThe 3dsMax node we are finding a writer for.
candidateWritersA vector of candidate prim writers, to be filtered.
Returns
Ordered list of applicable prim writers (Writers with explicit support first, followed with writers that can be used as fallback for this object).

◆ GetAllWriters()

static MaxUSDAPI std::vector< MaxUsdPrimWriterSharedPtr > MaxUsdPrimWriterRegistry::GetAllWriters ( const MaxUsdWriteJobContext jobCtx)
static

Returns all prim writers for a given write job context.

Parameters
jobCtxThe write job context to get writer for.
Returns
All registered prim writers

◆ Register()

static MaxUSDAPI void MaxUsdPrimWriterRegistry::Register ( const std::string &  key,
WriterFactoryFn  fn,
bool  fromPython = false 
)
static

Register a new prim writer via it's factory function.

Parameters
Aunique key for the writer. If not unique, an error is returned.
fnA factory function providing a MaxUsdPrimWriter subclass that can be used to write/
fromPythontrue if the writer is registered from python.

◆ Unregister()

static MaxUSDAPI void MaxUsdPrimWriterRegistry::Unregister ( const std::string &  key)
static

Unregisters a prim writer.

Parameters
keyThe unique key for the writer.

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