All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primWriterRegistry.h File Reference
+ Include dependency graph for primWriterRegistry.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UsdMayaPrimWriterRegistry
 Provides functionality to register and lookup USD writer plugins for Maya nodes. More...
 

Macros

#define PXRUSDMAYA_DEFINE_WRITER(mayaTypeName, argsVarName, ctxVarName)
 Defines a writer function for the given Maya type; the function should write a USD prim for the given Maya node. More...
 
#define PXRUSDMAYA_REGISTER_WRITER(mayaTypeName, writerClass)
 Registers a pre-existing writer class for the given Maya type; the writer class should be a subclass of UsdMayaPrimWriter with a three-place constructor that takes (const MFnDependencyNode& depNodeFn, const SdfPath& usdPath, UsdMayaWriteJobContext& jobCtx) as arguments. More...
 

Macro Definition Documentation

#define PXRUSDMAYA_DEFINE_WRITER (   mayaTypeName,
  argsVarName,
  ctxVarName 
)
Value:
struct UsdMayaWriterDummy_##mayaTypeName { }; \
static \
bool \
UsdMaya_PrimWriter_##mayaTypeName( \
UsdMayaPrimWriterContext*); \
UsdMayaWriterDummy_##mayaTypeName) \
{ \
#mayaTypeName, \
UsdMaya_PrimWriter_##mayaTypeName); \
} \
bool \
UsdMaya_PrimWriter_##mayaTypeName( \
const UsdMayaPrimWriterArgs& argsVarName, \
UsdMayaPrimWriterContext* ctxVarName)
#define TF_REGISTRY_FUNCTION_WITH_TAG(KEY_TYPE, TAG)
Define a function that is called on demand by TfRegistryManager.
Provides functionality to register and lookup USD writer plugins for Maya nodes.
This class holds read-only arguments that are passed into the writer plugins for the usdMaya library...
static PXRUSDMAYA_API void RegisterRaw(const std::string &mayaType, WriterFn fn)
Wraps fn in a WriterFactoryFn and registers the wrapped function as a prim writer provider...

Defines a writer function for the given Maya type; the function should write a USD prim for the given Maya node.

The return status indicates whether the operation succeeded.

Example:

* PXRUSDMAYA_DEFINE_WRITER(myCustomMayaNode, args, context) {
* context->GetUsdStage()->DefinePrim(context->GetAuthorPath());
* return true;
* }
*

Definition at line 143 of file primWriterRegistry.h.

#define PXRUSDMAYA_REGISTER_WRITER (   mayaTypeName,
  writerClass 
)
Value:
mayaTypeName##_##writerClass) \
{ \
#mayaTypeName, \
[]( \
const MFnDependencyNode& depNodeFn, \
const SdfPath& usdPath, \
return std::make_shared<writerClass>(depNodeFn, usdPath, jobCtx); \
}); \
}
Provides basic functionality and access to shared data for UsdMayaPrimWriters.
#define TF_REGISTRY_FUNCTION_WITH_TAG(KEY_TYPE, TAG)
Define a function that is called on demand by TfRegistryManager.
Provides functionality to register and lookup USD writer plugins for Maya nodes.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
static PXRUSDMAYA_API void Register(const std::string &mayaType, WriterFactoryFn fn)
Register fn as a factory function providing a UsdMayaPrimWriter subclass that can be used to write ma...

Registers a pre-existing writer class for the given Maya type; the writer class should be a subclass of UsdMayaPrimWriter with a three-place constructor that takes (const MFnDependencyNode& depNodeFn, const SdfPath& usdPath, UsdMayaWriteJobContext& jobCtx) as arguments.

Example:

* class MyWriter : public UsdMayaPrimWriter {
* MyWriter(
* const MFnDependencyNode& depNodeFn,
* const SdfPath& usdPath,
* // ...
* }
* };
* PXRUSDMAYA_REGISTER_WRITER(myCustomMayaNode, MyWriter);
*

Definition at line 180 of file primWriterRegistry.h.