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

This class provides an interface for reader plugins to communicate state back to the core usd maya logic as well as retrieve information set by other plugins. More...

Public Types

typedef std::map< std::string,
MObject > 
ObjectRegistry
 

Public Member Functions

PXRUSDMAYA_API UsdMayaPrimReaderContext (ObjectRegistry *pathNodeMap)
 
PXRUSDMAYA_API MObject GetMayaNode (const SdfPath &path, bool findAncestors) const
 Returns the prim was registered at path. More...
 
PXRUSDMAYA_API void RegisterNewMayaNode (const std::string &path, const MObject &mayaNode) const
 Record mayaNode prim as being created path. More...
 
PXRUSDMAYA_API bool GetPruneChildren () const
 returns true if prim traversal of the children of the current node can be pruned. More...
 
PXRUSDMAYA_API void SetPruneChildren (bool prune)
 If this plugin takes care of reading all of its children, it should SetPruneChildren(true). More...
 

Detailed Description

This class provides an interface for reader plugins to communicate state back to the core usd maya logic as well as retrieve information set by other plugins.

This class provides an interface for writer plugins to communicate state back to the core usd maya logic.

Maya operations should be made directly with the Maya API. Any additional state that needs to be stored that isn't directly related to the Maya scene should be stored here. For example, we track objects that are added for undo/redo.

We will likely need a mechanism where one plugin can invoke another one.

Definition at line 51 of file primReaderContext.h.

Member Function Documentation

PXRUSDMAYA_API MObject GetMayaNode ( const SdfPath path,
bool  findAncestors 
) const

Returns the prim was registered at path.

If findAncestors is true and no object was found for path, this will return the object that corresponding to its nearest ancestor.

Returns an invalid MObject if no such object exists.

PXRUSDMAYA_API bool GetPruneChildren ( ) const

returns true if prim traversal of the children of the current node can be pruned.

PXRUSDMAYA_API void RegisterNewMayaNode ( const std::string &  path,
const MObject &  mayaNode 
) const

Record mayaNode prim as being created path.

Calling code may be interested in new objects being created. Some reasons for this may be:

  • looking up later (for shader bindings, relationship targets, etc)
  • undo/redo purposes

Plugins should call this as needed.

PXRUSDMAYA_API void SetPruneChildren ( bool  prune)

If this plugin takes care of reading all of its children, it should SetPruneChildren(true).


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