AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AL::usdmaya::fileio::TransformIterator Class Reference

An iterator to walk over the transforms within a USD file. More...

#include <TransformIterator.h>

Public Member Functions

 TransformIterator (UsdStageRefPtr stage, const MDagPath &parentPath=MDagPath())
 ctor. Initialises the iterator to the root of the stage More...
 
 TransformIterator (const UsdPrim &startPrim, const MDagPath &startMayaPath)
 ctor. Initialises the iterator to the root of the stage More...
 
bool done () const
 return true if the iteration is complete More...
 
size_t depth () const
 returns the current iteration depth More...
 
const UsdPrim & prim () const
 return the current prim More...
 
void prune ()
 do not iterate over the children of this node
 
bool next ()
 move to the next item in the stage More...
 
void append (const MObject newNode)
 in order to keep the maya path in sync with the USD prim, at each iteration step you should pass in the MObject of the node in maya that mirrors your place in the USD hierarchy. Without this step the current dag path will not be valid. More...
 
MObject parent () const
 returns the parent transform of the current node. More...
 
MDagPath currentPath () const
 returns the current maya path equivalent of the current USD prim. More...
 

Detailed Description

An iterator to walk over the transforms within a USD file.

Constructor & Destructor Documentation

AL::usdmaya::fileio::TransformIterator::TransformIterator ( UsdStageRefPtr  stage,
const MDagPath &  parentPath = MDagPath() 
)

ctor. Initialises the iterator to the root of the stage

Parameters
stagethe stage to iterate over
parentPaththe DAG path of the proxy shape
AL::usdmaya::fileio::TransformIterator::TransformIterator ( const UsdPrim &  startPrim,
const MDagPath &  startMayaPath 
)

ctor. Initialises the iterator to the root of the stage

Parameters
startPrima prim in a stage where the iteration should start
startMayaPaththe DAG path of the proxy shape

Member Function Documentation

void AL::usdmaya::fileio::TransformIterator::append ( const MObject  newNode)
inline

in order to keep the maya path in sync with the USD prim, at each iteration step you should pass in the MObject of the node in maya that mirrors your place in the USD hierarchy. Without this step the current dag path will not be valid.

Parameters
newNodethe node to append into the stack
MDagPath AL::usdmaya::fileio::TransformIterator::currentPath ( ) const

returns the current maya path equivalent of the current USD prim.

Returns
the maya dag path
size_t AL::usdmaya::fileio::TransformIterator::depth ( ) const
inline

returns the current iteration depth

Returns
the iteration depth
bool AL::usdmaya::fileio::TransformIterator::done ( ) const
inline

return true if the iteration is complete

Returns
true when the iteration is complete
bool AL::usdmaya::fileio::TransformIterator::next ( )

move to the next item in the stage

Returns
true if we managed to move to the next prim, false if we have finished traversal
MObject AL::usdmaya::fileio::TransformIterator::parent ( ) const
inline

returns the parent transform of the current node.

Returns
the MObject of the parent node, r MObject::kNullObj if no valid parent
const UsdPrim& AL::usdmaya::fileio::TransformIterator::prim ( ) const
inline

return the current prim

Returns
the current prim

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