AL_USDMaya
0.16.6
USD to Maya Bridge
|
This class provides a context to store mappings between UsdPrims, and the Maya nodes that represent them. More...
#include <TranslatorContext.h>
Public Types | |
typedef TranslatorContext | This |
this type | |
typedef TfRefPtr< This > | RefPtr |
pointer to this type | |
Public Member Functions | |
const nodes::ProxyShape * | getProxyShape () const |
return the proxy shape associated with this context More... | |
UsdStageRefPtr | getUsdStage () const |
return the usd stage associated with this context More... | |
bool | getTransform (const UsdPrim &prim, MObjectHandle &object) |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getTransform (const SdfPath &path, MObjectHandle &object) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getMObject (const UsdPrim &prim, MObjectHandle &object, MTypeId type) |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getMObject (const SdfPath &path, MObjectHandle &object, MTypeId type) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getMObject (const UsdPrim &prim, MObjectHandle &object, MFn::Type type) |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getMObject (const SdfPath &path, MObjectHandle &object, MFn::Type type) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false. More... | |
bool | getMObjects (const UsdPrim &prim, MObjectHandleArray &returned) |
returns all of the maya nodes that were created by the specific prim More... | |
bool | getMObjects (const SdfPath &path, MObjectHandleArray &returned) |
returns all of the maya nodes that were created by the specific prim More... | |
void | insertItem (const UsdPrim &prim, MObjectHandle object) |
If within your custom translator plug-in you need to create any maya nodes, associate that maya node with the prim path by calling this method. More... | |
void | removeItems (const UsdPrim &prim) |
during a variant switch, if we lose a prim, then it's path will be passed into this method, and all the maya nodes that were created for it will be nuked. More... | |
void | removeItems (const SdfPath &path) |
during a variant switch, if we lose a prim, then it's path will be passed into this method, and all the maya nodes that were created for it will be nuked. More... | |
~TranslatorContext () | |
dtor | |
TfToken | getTypeForPath (SdfPath path) const |
given a path to a prim, return the prim type we are aware of at that path More... | |
void | registerItem (const UsdPrim &prim, MObjectHandle object) |
Internal method. If within your custom translator plug-in you need to create any maya nodes, associate that maya node with the prim path by calling this method. More... | |
MString | serialise () const |
serialises the content of the translator context to a text string. More... | |
void | deserialise (const MString &string) |
deserialises the string back into the translator context More... | |
Static Public Member Functions | |
static RefPtr | create (nodes::ProxyShape *proxyShape) |
construct a new context for the specified proxy shape node More... | |
This class provides a context to store mappings between UsdPrims, and the Maya nodes that represent them.
|
inlinestatic |
construct a new context for the specified proxy shape node
proxyShape | the proxy shape to associate the context with |
void AL::usdmaya::fileio::translators::TranslatorContext::deserialise | ( | const MString & | string | ) |
deserialises the string back into the translator context
string | the string to deserialised |
|
inline |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
prim | the usd prim |
object | the returned handle |
type | the type ID of the maya object you wish to retrieve. If the type ID is 0, the first node found will be returned. This may be useful if a prim type may create a type of node that is not known at compile time (e.g. a prim that creates a lambert, blinn, or phong based on some enum attribute). Another alternative would be to query all of the maya nodes via getMObjects |
bool AL::usdmaya::fileio::translators::TranslatorContext::getMObject | ( | const SdfPath & | path, |
MObjectHandle & | object, | ||
MTypeId | type | ||
) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
path | the usd prim path |
object | the returned handle |
type | the type ID of the maya object you wish to retrieve. If the type ID is 0, the first node found will be returned. This may be useful if a prim type may create a type of node that is not known at compile time (e.g. a prim that creates a lambert, blinn, or phong based on some enum attribute). Another alternative would be to query all of the maya nodes via getMObjects |
|
inline |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
prim | the usd prim |
object | the returned handle |
type | the type of the maya object you wish to retrieve. If the type is MFn::kInvalid, then the first node found will be returned. This may be useful if a prim type may create a type of node that is not known at compile time (e.g. a prim that creates a lambert, blinn, or phong based on some enum attribute). Another alternative would be to query all of the maya nodes via getMObjects |
bool AL::usdmaya::fileio::translators::TranslatorContext::getMObject | ( | const SdfPath & | path, |
MObjectHandle & | object, | ||
MFn::Type | type | ||
) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
path | the usd prim path |
object | the returned handle |
type | the type of the maya object you wish to retrieve. If the type is MFn::kInvalid, then the first node found will be returned. This may be useful if a prim type may create a type of node that is not known at compile time (e.g. a prim that creates a lambert, blinn, or phong based on some enum attribute). Another alternative would be to query all of the maya nodes via getMObjects |
|
inline |
returns all of the maya nodes that were created by the specific prim
prim | the prim to query |
returned | the returned list of MObjects |
bool AL::usdmaya::fileio::translators::TranslatorContext::getMObjects | ( | const SdfPath & | path, |
MObjectHandleArray & | returned | ||
) |
returns all of the maya nodes that were created by the specific prim
path | the path to the prim to query |
returned | the returned list of MObjects |
|
inline |
return the proxy shape associated with this context
|
inline |
given a USD prim, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
prim | the usd prim |
object | the returned handle |
bool AL::usdmaya::fileio::translators::TranslatorContext::getTransform | ( | const SdfPath & | path, |
MObjectHandle & | object | ||
) |
given a USD prim path, this will see whether a maya node exists for it. If it does, that will be returned in the object handle. If the object is found, true is returned, otherwise false.
path | the usd prim path |
object | the returned handle |
|
inline |
given a path to a prim, return the prim type we are aware of at that path
path | the prim path of a prim that was imported via a custom translator plug-in |
UsdStageRefPtr AL::usdmaya::fileio::translators::TranslatorContext::getUsdStage | ( | ) | const |
return the usd stage associated with this context
void AL::usdmaya::fileio::translators::TranslatorContext::insertItem | ( | const UsdPrim & | prim, |
MObjectHandle | object | ||
) |
If within your custom translator plug-in you need to create any maya nodes, associate that maya node with the prim path by calling this method.
prim | the prim you are currently importing in a translator |
object | the handle to the maya node you have created. |
void AL::usdmaya::fileio::translators::TranslatorContext::registerItem | ( | const UsdPrim & | prim, |
MObjectHandle | object | ||
) |
Internal method. If within your custom translator plug-in you need to create any maya nodes, associate that maya node with the prim path by calling this method.
prim | the prim you are currently importing in a translator |
object | the handle to the maya node you have created. |
|
inline |
during a variant switch, if we lose a prim, then it's path will be passed into this method, and all the maya nodes that were created for it will be nuked.
prim | the usd prim that was removed due to a variant switch |
void AL::usdmaya::fileio::translators::TranslatorContext::removeItems | ( | const SdfPath & | path | ) |
during a variant switch, if we lose a prim, then it's path will be passed into this method, and all the maya nodes that were created for it will be nuked.
path | path to the usd prim that was removed due to a variant switch |
MString AL::usdmaya::fileio::translators::TranslatorContext::serialise | ( | ) | const |
serialises the content of the translator context to a text string.