AL_USDMaya
0.29.4
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>
Classes | |
struct | PrimLookup |
An internal structure used to store a mapping between an SdfPath, the type of prim found at that location, the maya transform that may have been created (assuming the translator plugin specifies that it needs a parent transform), and any nodes that the translator plugin may have created. More... | |
struct | value_compare |
comparison utility (for sorting array of pointers to node references based on their path) More... | |
Public Types | |
typedef TranslatorContext | This |
this type | |
typedef TfRefPtr< This > | RefPtr |
pointer to this type | |
typedef std::vector< PrimLookup > | PrimLookups |
a sorted array of prim mappings | |
Public Member Functions | |
const nodes::ProxyShape * | getProxyShape () const |
return the proxy shape associated with this context More... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC bool | getMObjects (const SdfPath &path, MObjectHandleArray &returned) |
returns all of the maya nodes that were created by the specific prim More... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC | ~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... | |
AL_USDMAYA_PUBLIC void | updatePrimTypes () |
this method is used after a variant switch to check to see if the prim types have changed in the stage, and will update the internal state accordingly. | |
AL_USDMAYA_PUBLIC 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... | |
AL_USDMAYA_PUBLIC MString | serialise () const |
serialises the content of the translator context to a text string. More... | |
AL_USDMAYA_PUBLIC void | deserialise (const MString &string) |
deserialises the string back into the translator context More... | |
AL_USDMAYA_PUBLIC void | validatePrims () |
debugging utility to help keep track of prims during a variant switch | |
bool | hasEntry (const SdfPath &path, const TfToken &type) |
This method is used to determine whether this DB has an entry for the specified prim path and the given type. This is used within a variant switch to determine if a node can be updated, or whether it needs to be imported. More... | |
AL_USDMAYA_PUBLIC void | preRemoveEntry (const SdfPath &primPath, SdfPathVector &itemsToRemove, bool callPreUnload=true) |
This is called during a variant switch to determine whether the variant switch will allow Maya nodes to be updated, or whether they need to be deleted. More... | |
AL_USDMAYA_PUBLIC void | removeEntries (const SdfPathVector &itemsToRemove) |
call this to remove a prim from the DB (you do not need to lock/unlock here). More... | |
void | clearPrimMappings () |
This is used for testing only. Do not call. | |
AL_USDMAYA_PUBLIC bool | addExcludedGeometry (const SdfPath &newPath) |
add geometry to the exclusion list More... | |
AL_USDMAYA_PUBLIC bool | removeExcludedGeometry (const SdfPath &newPath) |
remove geometry from the exclusion list More... | |
const SdfPathSet & | excludedGeometry () |
retrieve currently excluded translator geometries More... | |
bool | isExcludedGeometryDirty () |
Retrieves if the the excluded geometry has been pushed to the renderer. More... | |
void | setForceDefaultRead (bool forceDefaultRead) |
bool | getForceDefaultRead () |
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.
|
inline |
add geometry to the exclusion list
newPath | the path to add as an excluded translator path |
|
inlinestatic |
construct a new context for the specified proxy shape node
proxyShape | the proxy shape to associate the context with |
AL_USDMAYA_PUBLIC void AL::usdmaya::fileio::translators::TranslatorContext::deserialise | ( | const MString & | string | ) |
deserialises the string back into the translator context
string | the string to deserialised |
|
inline |
retrieve currently excluded translator geometries
|
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 |
AL_USDMAYA_PUBLIC 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 |
AL_USDMAYA_PUBLIC 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 |
AL_USDMAYA_PUBLIC 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 |
AL_USDMAYA_PUBLIC 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 |
AL_USDMAYA_PUBLIC UsdStageRefPtr AL::usdmaya::fileio::translators::TranslatorContext::getUsdStage | ( | ) | const |
return the usd stage associated with this context
|
inline |
This method is used to determine whether this DB has an entry for the specified prim path and the given type. This is used within a variant switch to determine if a node can be updated, or whether it needs to be imported.
path | the path to the prim to query |
type | the type of prim |
AL_USDMAYA_PUBLIC 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. |
|
inline |
Retrieves if the the excluded geometry has been pushed to the renderer.
AL_USDMAYA_PUBLIC void AL::usdmaya::fileio::translators::TranslatorContext::preRemoveEntry | ( | const SdfPath & | primPath, |
SdfPathVector & | itemsToRemove, | ||
bool | callPreUnload = true |
||
) |
This is called during a variant switch to determine whether the variant switch will allow Maya nodes to be updated, or whether they need to be deleted.
primPath | the path to the prim that triggered the variant switch |
itemsToRemove | the returned list of items that need to be removed |
callPreUnload | true calling the preUnload on all the prims is needed. |
AL_USDMAYA_PUBLIC 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. |
AL_USDMAYA_PUBLIC void AL::usdmaya::fileio::translators::TranslatorContext::removeEntries | ( | const SdfPathVector & | itemsToRemove | ) |
call this to remove a prim from the DB (you do not need to lock/unlock here).
itemsToRemove | the prims that need to be removed from the DB. tearDown will be called on each prim |
|
inline |
remove geometry from the exclusion list
newPath | the path to add as an excluded translator path |
|
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 |
AL_USDMAYA_PUBLIC 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 |
AL_USDMAYA_PUBLIC MString AL::usdmaya::fileio::translators::TranslatorContext::serialise | ( | ) | const |
serialises the content of the translator context to a text string.