AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AL::usdmaya::fileio::translators::TranslatorBase Class Reference

Base class for maya translator usd plugins. The TfType of these plugins has to be derived from the base TfType, TranslatorBase. More...

#include <TranslatorBase.h>

Inheritance diagram for AL::usdmaya::fileio::translators::TranslatorBase:
AL::usdmaya::fileio::translators::TranslatorAbstract AL::usdmaya::fileio::translators::TranslatorTestPlugin

Public Types

typedef TranslatorBase This
 
typedef TfRefPtr< ThisRefPtr
 
- Public Types inherited from AL::usdmaya::fileio::translators::TranslatorAbstract
typedef TranslatorAbstract This
 this type
 
typedef TfRefPtr< ThisRefPtr
 the type of a reference this type
 
typedef TfWeakPtr< ThisPtr
 weak pointer to this type
 

Public Member Functions

virtual ~TranslatorBase ()
 dtor
 
virtual TfType getTranslatedType () const override
 returns the translated prim type
 
virtual TranslatorContextPtr context () const
 returns the context currently being used to translate the USD prims. The context can be used to add references to prims you have created in your translator plugins (see:
 
UsdStageRefPtr getUsdStage () const
 return the usd stage associated with this context More...
 
- Public Member Functions inherited from AL::usdmaya::fileio::translators::TranslatorAbstract
virtual ~TranslatorAbstract ()
 dtor
 
virtual bool needsTransformParent () const
 if the custom node type you are importing requires a parent transform (e.g. you are importing a shape node), then this method should return true. If however you do not need a parent transform (e.g. you are importing a texture!), then you can return false here. More...
 
virtual MStatus initialize ()
 Override this to do a one time initialization of your translator. Primarily this is to allow you to extract some MObject attribute handles from an MNodeClass, to avoid the need for calling findPlug at runtime (and the inherent cost of the strcmps/hash lookup that entails) More...
 
virtual MStatus import (const UsdPrim &prim, MObject &parent)
 Override this method to import a prim into your scene. More...
 
virtual MStatus postImport (const UsdPrim &prim)
 If your node needs to set up any relationships after import (for example, adding the node to a set, or making attribute connections), then all of that work should be performed here. More...
 
virtual MStatus preTearDown (UsdPrim &prim)
 This method will be called prior to the tear down process taking place. This is the last chance you have to do any serialisation whilst all of the existing nodes are available to query. More...
 
virtual MStatus tearDown (const SdfPath &path)
 If your plugin creates any nodes within Maya, then this method should be overridden to remove those nodes. This forms a central role within the variant switching system. More...
 
virtual bool supportsUpdate () const
 override this method and return true if the translator supports update More...
 
virtual MStatus update (const UsdPrim &prim)
 Optionally override this method to copy the attribute values from the prim onto the Maya nodes you have created. More...
 

Static Public Member Functions

static RefPtr manufacture (const std::string &primType, TranslatorContextPtr context)=delete
 Internal method used to create a new instance of a plugin translator. More...
 

Protected Member Functions

virtual void setTranslatedType (const TfType &translatedType)
 internal method. Used within AL_USDMAYA_DEFINE_TRANSLATOR macro to set the schema type of the node we translate. More...
 
virtual void setContext (const TranslatorContextPtr context)
 internal method. Used within AL_USDMAYA_DEFINE_TRANSLATOR macro to set the translation context More...
 

Detailed Description

Base class for maya translator usd plugins. The TfType of these plugins has to be derived from the base TfType, TranslatorBase.

Member Function Documentation

UsdStageRefPtr AL::usdmaya::fileio::translators::TranslatorBase::getUsdStage ( ) const
inline

return the usd stage associated with this context

Returns
the usd stage
static RefPtr AL::usdmaya::fileio::translators::TranslatorBase::manufacture ( const std::string &  primType,
TranslatorContextPtr  context 
)
staticdelete

Internal method used to create a new instance of a plugin translator.

Parameters
primTypethe type of translator to manufacture
contextthe translation context
Returns
a handle to the newly created plugin translator
virtual void AL::usdmaya::fileio::translators::TranslatorBase::setContext ( const TranslatorContextPtr  context)
inlineprotectedvirtual

internal method. Used within AL_USDMAYA_DEFINE_TRANSLATOR macro to set the translation context

Parameters
contextthe internal context
virtual void AL::usdmaya::fileio::translators::TranslatorBase::setTranslatedType ( const TfType &  translatedType)
inlineprotectedvirtual

internal method. Used within AL_USDMAYA_DEFINE_TRANSLATOR macro to set the schema type of the node we translate.

Parameters
translatedTypethe schema type name

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