AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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 MObjectToPrim createTranformChainsForSchemaPrims (nodes::ProxyShape *shape, const std::vector< UsdPrim > &schemaPrims, const MDagPath &proxyTransformPath)
 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::SchemaNodeRefDB *schemaNodeDB, const MObjectToPrim &objsToCreate)
 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::SchemaNodeRefDB *schemaNodeDB, const MObjectToPrim &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...
 

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::SchemaNodeRefDB schemaNodeDB,
const MObjectToPrim 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
schemaNodeDBthe database of plugin nodes imported into the scene (used for variant switching book keeping)
objsToCreatethe mapping returned from createTranformChainsForSchemaPrims
static void AL::usdmaya::cmds::ProxyShapePostLoadProcess::createSchemaPrims ( nodes::SchemaNodeRefDB schemaNodeDB,
const MObjectToPrim objsToCreate 
)
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
schemaNodeDBthe database of plugin nodes imported into the scene (used for variant switching book keeping)
objsToCreatethe mapping returned from createTranformChainsForSchemaPrims
static MObjectToPrim AL::usdmaya::cmds::ProxyShapePostLoadProcess::createTranformChainsForSchemaPrims ( nodes::ProxyShape shape,
const std::vector< UsdPrim > &  schemaPrims,
const MDagPath &  proxyTransformPath 
)
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
Returns
a mapping from the MObjects created, 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

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