All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdMayaPrimReaderRegistry Class Reference

Provides functionality to register and lookup usd Maya reader plugins. More...

Public Types

typedef std::function
< UsdMayaPrimReaderSharedPtr(const
UsdMayaPrimReaderArgs &) > 
ReaderFactoryFn
 Reader factory function, i.e. More...
 
typedef std::function< bool(const
UsdMayaPrimReaderArgs
&, UsdMayaPrimReaderContext *) > 
ReaderFn
 Reader function, i.e. More...
 

Static Public Member Functions

static PXRUSDMAYA_API void Register (const TfType &type, ReaderFactoryFn fn)
 Register fn as a reader provider for type. More...
 
template<typename T >
static void Register (ReaderFactoryFn fn)
 Register fn as a reader provider for T. More...
 
static PXRUSDMAYA_API void RegisterRaw (const TfType &type, ReaderFn fn)
 Wraps fn in a ReaderFactoryFn and registers that factory function as a reader provider for T. More...
 
template<typename T >
static void RegisterRaw (ReaderFn fn)
 Wraps fn in a ReaderFactoryFn and registers that factory function as a reader provider for T. More...
 
static PXRUSDMAYA_API
ReaderFactoryFn 
Find (const TfToken &usdTypeName)
 Finds a reader factory if one exists for usdTypeName. More...
 
static PXRUSDMAYA_API
ReaderFactoryFn 
FindOrFallback (const TfToken &usdTypeName)
 Similar to Find(), but returns a "fallback" prim reader factory if none can be found for usdTypeName. More...
 

Detailed Description

Provides functionality to register and lookup usd Maya reader plugins.

Use PXRUSDMAYA_DEFINE_READER(MyUsdType, args, ctx) to register a new reader for maya.

In order for the core system to discover the plugin, you should also have a plugInfo.json file that contains the type and maya plugin to load:

* {
* "UsdMaya": {
* "PrimReader": {
* "mayaPlugin": "myMayaPlugin",
* "providesTranslator": [
* "MyUsdType"
* ]
* }
* }
* }
*

Definition at line 62 of file primReaderRegistry.h.

Member Typedef Documentation

typedef std::function< UsdMayaPrimReaderSharedPtr ( const UsdMayaPrimReaderArgs&) > ReaderFactoryFn

Reader factory function, i.e.

a function that creates a prim reader for the given prim reader args.

Definition at line 67 of file primReaderRegistry.h.

typedef std::function< bool ( const UsdMayaPrimReaderArgs&, UsdMayaPrimReaderContext*) > ReaderFn

Reader function, i.e.

a function that reads a prim. This is the signature of the function declared in the PXRUSDMAYA_DEFINE_READER macro.

Definition at line 74 of file primReaderRegistry.h.

Member Function Documentation

static PXRUSDMAYA_API ReaderFactoryFn Find ( const TfToken usdTypeName)
static

Finds a reader factory if one exists for usdTypeName.

usdTypeName should be a usd typeName, for example,

* prim.GetTypeName()
*
static PXRUSDMAYA_API ReaderFactoryFn FindOrFallback ( const TfToken usdTypeName)
static

Similar to Find(), but returns a "fallback" prim reader factory if none can be found for usdTypeName.

Thus, this always returns a valid reader factory.

static PXRUSDMAYA_API void Register ( const TfType type,
ReaderFactoryFn  fn 
)
static

Register fn as a reader provider for type.

static void Register ( ReaderFactoryFn  fn)
inlinestatic

Register fn as a reader provider for T.

Example for registering a reader factory in your custom plugin, assuming that MyType is registered with the TfType system:

* class MyReader : public UsdMayaPrimReader {
* static UsdMayaPrimReaderSharedPtr Create(
* };
* UsdMayaPrimReaderRegistry::Register<MyType>(MyReader::Create);
* }
*

Definition at line 94 of file primReaderRegistry.h.

static PXRUSDMAYA_API void RegisterRaw ( const TfType type,
ReaderFn  fn 
)
static

Wraps fn in a ReaderFactoryFn and registers that factory function as a reader provider for T.

This is a helper method for the macro PXRUSDMAYA_DEFINE_READER; you probably want to use PXRUSDMAYA_DEFINE_READER directly instead.

static void RegisterRaw ( ReaderFn  fn)
inlinestatic

Wraps fn in a ReaderFactoryFn and registers that factory function as a reader provider for T.

This is a helper method for the macro PXRUSDMAYA_DEFINE_READER; you probably want to use PXRUSDMAYA_DEFINE_READER directly instead.

Definition at line 117 of file primReaderRegistry.h.


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