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

When importing a new usd stage into an AL::usdmaya::nodes::ProxyShape, there are a selection of post import processes that need to take place in order to import any custom usd plugins found. More...

#include <ProxyShapePostLoadProcess.h>

Public Types

typedef std::vector< std::pair
< MObject, UsdPrim > > 
MObjectToPrim
 a mapping from an MObject to a UsdPrim
 

Static Public Member Functions

static MStatus initialise (nodes::ProxyShape *shape)
 called after a proxy shape has been created. Traverses the prim hierarchy and looks to see whether any custom plugin translators need to be called, and performs additional book-keeping. More...
 
static void createTranformChainsForSchemaPrims (nodes::ProxyShape *shape, const std::vector< UsdPrim > &schemaPrims, const MDagPath &proxyTransformPath, MObjectToPrim &objsToCreate)
 given a specific proxy shape, and a collection of UsdPrims that represent custom DagNode types, this will generate a transform hierarchy that will allow you to map the UsdPrims to equivalent maya transforms More...
 
static void createSchemaPrims (nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToCreate, const fileio::translators::TranslatorParameters &param=fileio::translators::TranslatorParameters())
 After transforms exist to parent the custom plugin-prim types (i.e. after a call to createTranformChainsForSchemaPrims), this method should be called to call the plugin translators for all those nodes that should be imported into the Maya Scene. More...
 
static void connectSchemaPrims (nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToCreate)
 called once all plugin nodes have been created, and will request that each plugin translator performs the postImport fixup to safely make any connections between Maya nodes More...
 
static void updateSchemaPrims (nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToUpdate)
 updates the list of UsdPrims after a variant switch (but when the nodes have not changed) More...
 

Detailed Description

When importing a new usd stage into an AL::usdmaya::nodes::ProxyShape, there are a selection of post import processes that need to take place in order to import any custom usd plugins found.

  • If any custom plugin prims are found, that represent DAG nodes (e.g. they are shapes or transforms), then a hierarchy of AL::usdmaya::nodes::Transform nodes will be generated so that the USD transform values found on the prims, will have a direct mapping to a maya transform. This allows use of the standard Maya scale/translate/rotate manipulators to control maya nodes directly.
  • For every custom plugin prim found, that node will need to be translated into Maya, and then connected up with the other imported prims.
  • A certain amount of book keeping information will need to be generated, so that variant switching can be used to modify or remove those nodes at a later date.

This helper class manages those processes.

Member Function Documentation

static void AL::usdmaya::cmds::ProxyShapePostLoadProcess::connectSchemaPrims ( nodes::ProxyShape proxy,
const std::vector< UsdPrim > &  objsToCreate 
)
static

called once all plugin nodes have been created, and will request that each plugin translator performs the postImport fixup to safely make any connections between Maya nodes

Parameters
proxythe proxy shape to connect the schema prims
objsToCreatethe mapping returned from createTranformChainsForSchemaPrims
static void AL::usdmaya::cmds::ProxyShapePostLoadProcess::createSchemaPrims ( nodes::ProxyShape proxy,
const std::vector< UsdPrim > &  objsToCreate,
const fileio::translators::TranslatorParameters param = fileio::translators::TranslatorParameters() 
)
static

After transforms exist to parent the custom plugin-prim types (i.e. after a call to createTranformChainsForSchemaPrims), this method should be called to call the plugin translators for all those nodes that should be imported into the Maya Scene.

Parameters
proxythe proxy shape to create the schema prims on
objsToCreatethe mapping returned from createTranformChainsForSchemaPrims
paramthe translator plugin options
static void AL::usdmaya::cmds::ProxyShapePostLoadProcess::createTranformChainsForSchemaPrims ( nodes::ProxyShape shape,
const std::vector< UsdPrim > &  schemaPrims,
const MDagPath &  proxyTransformPath,
MObjectToPrim objsToCreate 
)
static

given a specific proxy shape, and a collection of UsdPrims that represent custom DagNode types, this will generate a transform hierarchy that will allow you to map the UsdPrims to equivalent maya transforms

Parameters
shapethe proxy shape these transforms are being pulled in from
schemaPrimsan array of prims for which transforms should be created
proxyTransformPatha path to the transform node that resides above the proxy shape
objsToCreatea mapping from the MObjects created (for the transform nodes), to the UsdPrim that is represented
static MStatus AL::usdmaya::cmds::ProxyShapePostLoadProcess::initialise ( nodes::ProxyShape shape)
static

called after a proxy shape has been created. Traverses the prim hierarchy and looks to see whether any custom plugin translators need to be called, and performs additional book-keeping.

Parameters
shapethe proxy shape node that has just been created
Returns
MS::kSuccess if ok
static void AL::usdmaya::cmds::ProxyShapePostLoadProcess::updateSchemaPrims ( nodes::ProxyShape proxy,
const std::vector< UsdPrim > &  objsToUpdate 
)
static

updates the list of UsdPrims after a variant switch (but when the nodes have not changed)

Parameters
proxythe proxy shape to update
objsToUpdatethe list of prims to be updated

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