AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AL::usdmaya::nodes::ProxyShape Class Reference

A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute. More...

#include <ProxyShape.h>

Inheritance diagram for AL::usdmaya::nodes::ProxyShape:
AL::maya::NodeHelper

Public Member Functions

 ProxyShape ()
 ctor
 
 ~ProxyShape ()
 dtor
 
Type Info & Registration
 AL_MAYA_DECLARE_NODE ()
 
Layers API
LayerfindLayer (SdfLayerHandle handle)
 Locate the maya node associated with the specified layer. More...
 
MString findLayerMayaName (SdfLayerHandle handle)
 Locate the name of the maya node associated with the specified layer. More...
 
LayergetLayer ()
 return the node that represents the root layer More...
 
Input Attributes
 AL_DECL_ATTRIBUTE (filePath)
 the input USD file path for this proxy
 
 AL_DECL_ATTRIBUTE (primPath)
 a path to a prim you want to view with this shape
 
 AL_DECL_ATTRIBUTE (excludePrimPaths)
 a comma seperated list of prims you don't want to see.
 
 AL_DECL_ATTRIBUTE (time)
 the input time value (probably connected to time1.outTime)
 
 AL_DECL_ATTRIBUTE (timeOffset)
 an offset, in GUI time units, where the animation should start playback
 
 AL_DECL_ATTRIBUTE (timeScalar)
 
 AL_DECL_ATTRIBUTE (complexity)
 the subdiv complexity used
 
 AL_DECL_ATTRIBUTE (displayGuides)
 display guide
 
 AL_DECL_ATTRIBUTE (displayRenderGuides)
 display render guide
 
 AL_DECL_ATTRIBUTE (layers)
 display render guide
 
 AL_DECL_ATTRIBUTE (serializedSessionLayer)
 serialised session layer
 
 AL_DECL_ATTRIBUTE (serializedArCtx)
 serialised asset resolver context
 
 AL_DECL_ATTRIBUTE (serializedTrCtx)
 serialised translator context
 
 AL_DECL_ATTRIBUTE (unloaded)
 Open the stage unloaded.
 
 AL_DECL_ATTRIBUTE (drivenPrimPaths)
 an array of strings that represent the paths to be driven
 
 AL_DECL_ATTRIBUTE (drivenVisibility)
 an array of visibility flags for the driven transforms
 
 AL_DECL_ATTRIBUTE (drivenTranslate)
 an array of translation values for the driven transforms
 
 AL_DECL_ATTRIBUTE (drivenScale)
 an array of scale values for the driven transforms
 
 AL_DECL_ATTRIBUTE (drivenRotate)
 an array of rotation values for the driven transforms
 
 AL_DECL_ATTRIBUTE (drivenRotateOrder)
 an array of rotate order values for the driven transforms
 
 AL_DECL_ATTRIBUTE (ambient)
 ambient display colour
 
 AL_DECL_ATTRIBUTE (diffuse)
 diffuse display colour
 
 AL_DECL_ATTRIBUTE (specular)
 specular display colour
 
 AL_DECL_ATTRIBUTE (emission)
 emission display colour
 
 AL_DECL_ATTRIBUTE (shininess)
 material shininess
 
Output Attributes
 AL_DECL_ATTRIBUTE (outTime)
 outTime = (time - timeOffset) * timeScalar
 
 AL_DECL_ATTRIBUTE (outStageData)
 inStageData —> inStageDataCached —> outStageData
 
Public Utils
UsdStageRefPtr getUsdStage () const
 provides access to the UsdStage that this proxy shape is currently representing More...
 
bool getRenderAttris (void *attribs, const MHWRender::MFrameContext &frameContext, const MDagPath &dagPath)
 gets hold of the attributes on this node that control the rendering in some way More...
 
MBoundingBox boundingBox () const override
 compute bounds
 
- Public Member Functions inherited from AL::maya::NodeHelper
 NodeHelper ()
 ctor
 
 ~NodeHelper ()
 dtor
 

AL_usdmaya_Transform utils

A set of commands to manipulate the chains of transforms that map to the usd prims found in a stage. There are 3 main reasons for a transform node to exist within maya:

  • They are required to provide a parent transform for a schema prim that will be imported into maya.
  • They are the parent node of an object that has been selected
  • The user has requested that they be imported
enum  TransformReason { kSelection = 1 << 0, kRequested = 1 << 1, kRequired = 1 << 2 }
 an enum describing the reason that a transform exists in the scene More...
 
bool isRequiredPath (const SdfPath &path) const
 returns true if the path is required for an imported schema prim More...
 
MObject findRequiredPath (const SdfPath &path) const
 returns the MObject of the maya transform for requested path (or MObject::kNullObj) More...
 
std::vector< UsdPrim > huntForNativeNodesUnderPrim (const MDagPath &proxyTransformPath, SdfPath startPath)
 traverses the UsdStage looking for the prims that are going to be handled by custom transformer plug-ins. More...
 
MObject makeUsdTransformChain (const UsdPrim &usdPrim, MDagModifier &modifier, TransformReason reason, MDGModifier *modifier2=0, uint32_t *createCount=0)
 constructs a single chain of transform nodes from the usdPrim to the root of this proxy shape. More...
 
void makeUsdTransforms (const UsdPrim &usdPrim, MDagModifier &modifier, TransformReason reason, MDGModifier *modifier2=0)
 Will construct AL_usdmaya_Transform nodes for all of the prims from the specified usdPrim and down. More...
 
void removeUsdTransformChain (const UsdPrim &usdPrim, MDagModifier &modifier, TransformReason reason)
 will destroy all of the AL_usdmaya_Transform nodes from the prim specified, up to the root (unless any of those transform nodes are in use by another imported prim). More...
 
void removeUsdTransforms (const UsdPrim &usdPrim, MDagModifier &modifier, TransformReason reason)
 Will destroy all AL_usdmaya_Transform nodes found underneath the prim (unless those nodes are required for another purpose). More...
 
void printRefCounts () const
 Debugging util - prints out the reference counts for each AL_usdmaya_Transform that currently exists in the scene.
 
void createSelectionChangedCallback ()
 create a callback to destroy unused transform nodes when the selection changes.
 
void destroySelectionChangedCallback ()
 destroys the selection callback
 
void destroyTransformReferences ()
 destroys all internal transform references
 
void unloadMayaReferences ()
 unloads all maya references More...
 
nodes::SchemaNodeRefDBschemaDB ()
 return a reference to the DB of schema prims imported via custom translators (used for variant switching) More...
 
void serialiseTranslatorContext ()
 serialises the translator context
 
void deserialiseTranslatorContext ()
 deserialises the translator context
 
void constructGLImagingEngine ()
 constructs the USD imaging engine for this shape
 
UsdImagingGLHdEngine * engine () const
 returns the usd imaging engine for this proxy shape More...
 
SdfPathVector & selectedPaths ()
 returns the paths of the selected items within the proxy shape More...
 
void findExcludedGeometry ()
 searches for the excluded geometry
 
UsdPrim getRootPrim ()
 if a root prim has been specified by the user in the proxy shape AE, then this method will return the associated prim (used by the Hydra rendering code to select a root to render from). If no prim has been specified, the pseudo root will be passed to UsdImaging More...
 

Additional Inherited Members

- Public Types inherited from AL::maya::NodeHelper
enum  AttributeFlags {
  kCached = 1 << 0, kReadable = 1 << 1, kWritable = 1 << 2, kStorable = 1 << 3,
  kAffectsAppearance = 1 << 4, kKeyable = 1 << 5, kConnectable = 1 << 6, kArray = 1 << 7,
  kColour = 1 << 8, kHidden = 1 << 9, kInternal = 1 << 10, kAffectsWorldSpace = 1 << 11,
  kUsesArrayDataBuilder = 1 << 12, kDontAddToNode = 1 << 30, kDynamic = 1 << 31
}
 A set of bit flags you can apply to an attribute. More...
 
enum  FileMode {
  kSave = 0, kLoad = 1, kDirectoryWithFiles = 2, kDirectory = 3,
  kMultiLoad = 4
}
 Specify the type of file/dir path when adding file path attributes. See addFilePathAttr. More...
 
- Static Public Member Functions inherited from AL::maya::NodeHelper
static bool inputBoolValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input boolean value from the dataBlock from the specified attribute More...
 
static int8_t inputInt8Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 8 bit integer value from the dataBlock from the specified attribute More...
 
static int16_t inputInt16Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 16 bit integer value from the dataBlock from the specified attribute More...
 
static int32_t inputInt32Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 32 bit integer value from the dataBlock from the specified attribute More...
 
static int64_t inputInt64Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 64 bit integer value from the dataBlock from the specified attribute More...
 
static float inputFloatValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input float value from the dataBlock from the specified attribute More...
 
static double inputDoubleValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input double value from the dataBlock from the specified attribute More...
 
static MMatrix inputMatrixValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input matrix value from the dataBlock from the specified attribute More...
 
static MPoint inputPointValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input point value from the dataBlock from the specified attribute More...
 
static MFloatPoint inputFloatPointValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input point value from the dataBlock from the specified attribute More...
 
static MVector inputVectorValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input vector value from the dataBlock from the specified attribute More...
 
static MTime inputTimeValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input time value from the dataBlock from the specified attribute More...
 
static MFloatVector inputFloatVectorValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input vector value from the dataBlock from the specified attribute More...
 
static MColor inputColourValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input colour value from the dataBlock from the specified attribute More...
 
static MString inputStringValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input string value from the dataBlock from the specified attribute More...
 
static MPxData * inputDataValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input data value from the dataBlock from the specified attribute More...
 
template<typename MPxDataType >
static MPxDataType * inputDataValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input data value from the dataBlock from the specified attribute More...
 
static MStatus outputBoolValue (MDataBlock &dataBlock, const MObject &attribute, bool value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt8Value (MDataBlock &dataBlock, const MObject &attribute, int8_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt16Value (MDataBlock &dataBlock, const MObject &attribute, int16_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt32Value (MDataBlock &dataBlock, const MObject &attribute, int32_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt64Value (MDataBlock &dataBlock, const MObject &attribute, int64_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatValue (MDataBlock &dataBlock, const MObject &attribute, float value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputDoubleValue (MDataBlock &dataBlock, const MObject &attribute, double value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputMatrixValue (MDataBlock &dataBlock, const MObject &attribute, const MMatrix &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputPointValue (MDataBlock &dataBlock, const MObject &attribute, const MPoint &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatPointValue (MDataBlock &dataBlock, const MObject &attribute, const MFloatPoint &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputVectorValue (MDataBlock &dataBlock, const MObject &attribute, const MVector &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputEulerValue (MDataBlock &dataBlock, const MObject &attribute, const MEulerRotation &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatVectorValue (MDataBlock &dataBlock, const MObject &attribute, const MFloatVector &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputColourValue (MDataBlock &dataBlock, const MObject &attribute, const MColor &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputStringValue (MDataBlock &dataBlock, const MObject &attribute, const MString &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputTimeValue (MDataBlock &dataBlock, const MObject &attribute, const MTime &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputDataValue (MDataBlock &dataBlock, const MObject &attribute, MPxData *value)
 Set the output value of the specified attribute in the datablock. More...
 
static MPxData * createData (const MTypeId &dataTypeId, MObject &data)
 helper method to create new data objects of the specified data type More...
 
template<typename MPxDataType >
static MPxDataType * createData (const MTypeId &dataTypeId, MObject &data)
 helper method to create new data objects of the specified data type More...
 
static void setNodeType (const MString &typeName)
 Sets the node type name you are adding attributes. Please call this before adding any frames! More...
 
static void addFrame (const char *frameTitle)
 Add a new frame control into the AE template. More...
 
static MObject addCompoundAttr (const char *longName, const char *shortName, uint32_t flags, std::initializer_list< MObject > list)
 add a new compound attribute to this node type More...
 
static MObject addEnumAttr (const char *longName, const char *shortName, uint32_t flags, const char *const *strings, const int16_t *values)
 add a new enum attribute to this node type More...
 
static MObject addStringAttr (const char *longName, const char *shortName, uint32_t flags, bool forceShow=false)
 add a new string attribute to this node type. More...
 
static MObject addFilePathAttr (const char *longName, const char *shortName, uint32_t flags, FileMode fileMode, const char *fileFilter="")
 add a new file path attribute to this node type. More...
 
static MObject addInt8Attr (const char *longName, const char *shortName, int8_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt16Attr (const char *longName, const char *shortName, int16_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt32Attr (const char *longName, const char *shortName, int32_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt64Attr (const char *longName, const char *shortName, int64_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addFloatAttr (const char *longName, const char *shortName, float defaultValue, uint32_t flags)
 add a new floating point attribute to this node type. More...
 
static MObject addDoubleAttr (const char *longName, const char *shortName, double defaultValue, uint32_t flags)
 add a new double attribute to this node type. More...
 
static MObject addTimeAttr (const char *longName, const char *shortName, const MTime &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addDistanceAttr (const char *longName, const char *shortName, const MDistance &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addAngleAttr (const char *longName, const char *shortName, const MAngle &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addBoolAttr (const char *longName, const char *shortName, bool defaultValue, uint32_t flags)
 add a new boolean attribute to this node type. More...
 
static MObject addFloat3Attr (const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags)
 add a new float3 attribute to this node type. More...
 
static MObject addAngle3Attr (const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags)
 add a new float3 attribute to this node type. More...
 
static MObject addDistance3Attr (const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags)
 add a new float3 attribute to this node type. More...
 
static MObject addPointAttr (const char *longName, const char *shortName, const MPoint &defaultValue, uint32_t flags)
 add a new point attribute to this node type. More...
 
static MObject addFloatPointAttr (const char *longName, const char *shortName, const MFloatPoint &defaultValue, uint32_t flags)
 add a new float point attribute to this node type. More...
 
static MObject addVectorAttr (const char *longName, const char *shortName, const MVector &defaultValue, uint32_t flags)
 add a new vector attribute to this node type. More...
 
static MObject addFloatVectorAttr (const char *longName, const char *shortName, const MFloatVector &defaultValue, uint32_t flags)
 add a new float vector attribute to this node type. More...
 
static MObject addColourAttr (const char *longName, const char *shortName, const MColor &defaultValue, uint32_t flags)
 add a new colour attribute to this node type. More...
 
static MObject addMatrix2x2Attr (const char *longName, const char *shortName, const float defaultValue[2][2], uint32_t flags)
 add a new matrix attribute to this node type. More...
 
static MObject addMatrix3x3Attr (const char *longName, const char *shortName, const float defaultValue[3][3], uint32_t flags)
 add a new matrix attribute to this node type. More...
 
static MObject addMatrixAttr (const char *longName, const char *shortName, const MMatrix &defaultValue, uint32_t flags)
 add a new matrix attribute to this node type. More...
 
static MObject addDataAttr (const char *longName, const char *shortName, MFnData::Type type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour=MFnAttribute::kNothing)
 add a new data attribute to this node type. More...
 
static MObject addDataAttr (const char *longName, const char *shortName, const MTypeId &type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour=MFnAttribute::kNothing)
 add a new data attribute to this node type. More...
 
static MObject addMessageAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new message attribute to this node type. More...
 
static MObject addVec2hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec3hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec4hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
template<typename datatype >
static void setMinMax (MObject obj, datatype minimum, datatype maximum)
 set the min/max values on a numeric attribute More...
 
template<typename datatype >
static void setMinMax (MObject obj, datatype minimum, datatype maximum, datatype softmin, datatype softmax)
 set the min/max/softmax values on a numeric attribute More...
 
static void addBaseTemplate (const std::string &baseTemplate)
 used to add additional references to AETemplate calls for standard types, e.g. "AEsurfaceShapeTemplate" these will be inserted into the correct location More...
 
static void generateAETemplate ()
 This method will construct up the MEL script code for the attribute editor template for your node. Once constructed, the code will be executed silently in the background. If you wish to see the code being executed, enable 'echo all commands' in the MEL script editor prior to loading your plug-in.
 
static MStatus addStringAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, bool forceShow=false, MObject *attribute=0)
 add a new string attribute to this node type. More...
 
static MStatus addFilePathAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, FileMode fileMode, const char *fileFilter="", MObject *attribute=0)
 add a new file path attribute to this node type. More...
 
static MStatus addInt8Attr (const MObject &node, const char *longName, const char *shortName, int8_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt16Attr (const MObject &node, const char *longName, const char *shortName, int16_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt32Attr (const MObject &node, const char *longName, const char *shortName, int32_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt64Attr (const MObject &node, const char *longName, const char *shortName, int64_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addFloatAttr (const MObject &node, const char *longName, const char *shortName, float defaultValue, uint32_t flags, MObject *attribute=0)
 add a new floating point attribute to this node type. More...
 
static MStatus addDoubleAttr (const MObject &node, const char *longName, const char *shortName, double defaultValue, uint32_t flags, MObject *attribute=0)
 add a new double attribute to this node type. More...
 
static MStatus addTimeAttr (const MObject &node, const char *longName, const char *shortName, const MTime &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addDistanceAttr (const MObject &node, const char *longName, const char *shortName, const MDistance &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addAngleAttr (const MObject &node, const char *longName, const char *shortName, const MAngle &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addBoolAttr (const MObject &node, const char *longName, const char *shortName, bool defaultValue, uint32_t flags, MObject *attribute=0)
 add a new boolean attribute to this node type. More...
 
static MStatus addFloat3Attr (const MObject &node, const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags, MObject *attribute=0)
 add a new float3 attribute to this node type. More...
 
static MStatus addAngle3Attr (const MObject &node, const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags, MObject *attribute=0)
 add a new float3 attribute to this node type. More...
 
static MStatus addPointAttr (const MObject &node, const char *longName, const char *shortName, const MPoint &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new point attribute to this node type. More...
 
static MStatus addFloatPointAttr (const MObject &node, const char *longName, const char *shortName, const MFloatPoint &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new float point attribute to this node type. More...
 
static MStatus addVectorAttr (const MObject &node, const char *longName, const char *shortName, const MVector &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new vector attribute to this node type. More...
 
static MStatus addFloatVectorAttr (const MObject &node, const char *longName, const char *shortName, const MFloatVector &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new float vector attribute to this node type. More...
 
static MStatus addColourAttr (const MObject &node, const char *longName, const char *shortName, const MColor &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new colour attribute to this node type. More...
 
static MStatus addMatrixAttr (const MObject &node, const char *longName, const char *shortName, const MMatrix &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
static MStatus addMatrix2x2Attr (const MObject &node, const char *longName, const char *shortName, const float defaultValue[2][2], uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
static MStatus addMatrix3x3Attr (const MObject &node, const char *longName, const char *shortName, const float defaultValue[3][3], uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
static MStatus addDataAttr (const MObject &node, const char *longName, const char *shortName, MFnData::Type type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour=MFnAttribute::kNothing, MObject *attribute=0)
 add a new data attribute to this node type. More...
 
static MStatus addDataAttr (const MObject &node, const char *longName, const char *shortName, const MTypeId &type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour=MFnAttribute::kNothing, MObject *attribute=0)
 add a new data attribute to this node type. More...
 
static MStatus addMessageAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new message attribute to this node type. More...
 
static MStatus addVec2hAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D floating point vector attribute to this node type. More...
 
static MStatus addVec2fAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D floating point vector attribute to this node type. More...
 
static MStatus addVec2iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D integer vector attribute to this node type. More...
 
static MStatus addVec2dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D double precision vector attribute to this node type. More...
 
static MStatus addVec3hAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D floating point vector attribute to this node type. More...
 
static MStatus addVec3fAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D floating point vector attribute to this node type. More...
 
static MStatus addVec3iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D integer vector attribute to this node type. More...
 
static MStatus addVec3dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D double precision vector attribute to this node type. More...
 
static MStatus addVec4hAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D floating point vector attribute to this node type. More...
 
static MStatus addVec4fAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D floating point vector attribute to this node type. More...
 
static MStatus addVec4iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D integer vector attribute to this node type. More...
 
static MStatus addVec4dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D double precision vector attribute to this node type. More...
 

Detailed Description

A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute.

Member Enumeration Documentation

an enum describing the reason that a transform exists in the scene

Enumerator
kSelection 

the node exists for selection

kRequested 

the node has been requested by a user

kRequired 

the node is required for an imported schema prim

Member Function Documentation

AL::usdmaya::nodes::ProxyShape::AL_DECL_ATTRIBUTE ( timeScalar  )

a scalar value that can speed up (values greater than 1) or slow down (values less than one) or reverse (negative values) the playback of the animation.

UsdImagingGLHdEngine* AL::usdmaya::nodes::ProxyShape::engine ( ) const
inline

returns the usd imaging engine for this proxy shape

Returns
the imagine engin instance for this shape (shared between draw override and shape ui)
Layer* AL::usdmaya::nodes::ProxyShape::findLayer ( SdfLayerHandle  handle)

Locate the maya node associated with the specified layer.

Parameters
handlethe usd layer to locate
Returns
a pointer to the maya node that references the layer, or NULL if the layer was not found
MString AL::usdmaya::nodes::ProxyShape::findLayerMayaName ( SdfLayerHandle  handle)

Locate the name of the maya node associated with the specified layer.

Parameters
handlethe usd layer name to locate
Returns
the name of the maya node that references the layer, or and empty string if the layer was not found
MObject AL::usdmaya::nodes::ProxyShape::findRequiredPath ( const SdfPath &  path) const
inline

returns the MObject of the maya transform for requested path (or MObject::kNullObj)

Parameters
paththe usd prim path to look up
Returns
the MObject for the parent transform to the path specified
Layer* AL::usdmaya::nodes::ProxyShape::getLayer ( )

return the node that represents the root layer

Returns
the root layer, or NULL if stage is invalid
bool AL::usdmaya::nodes::ProxyShape::getRenderAttris ( void *  attribs,
const MHWRender::MFrameContext &  frameContext,
const MDagPath &  dagPath 
)

gets hold of the attributes on this node that control the rendering in some way

Parameters
attribsthe returned set of render attributes (should be of type: UsdImagingGLEngine::RenderParams*. Hiding this behind a void pointer to prevent UsdImagingGLEngine leaking into the translator plugin dependencies)
frameContextthe frame context for rendering
dagPaththe dag path of the node being rendered
Returns
true if the attribs could be retrieved (i.e. is the stage is valid)
UsdPrim AL::usdmaya::nodes::ProxyShape::getRootPrim ( )
inline

if a root prim has been specified by the user in the proxy shape AE, then this method will return the associated prim (used by the Hydra rendering code to select a root to render from). If no prim has been specified, the pseudo root will be passed to UsdImaging

Returns
the prim specified by the user (if valid), the pseudo root if no prim has been specified, or a NULL prim if the stage is invalid.
UsdStageRefPtr AL::usdmaya::nodes::ProxyShape::getUsdStage ( ) const

provides access to the UsdStage that this proxy shape is currently representing

Returns
the proxy shape
std::vector<UsdPrim> AL::usdmaya::nodes::ProxyShape::huntForNativeNodesUnderPrim ( const MDagPath &  proxyTransformPath,
SdfPath  startPath 
)

traverses the UsdStage looking for the prims that are going to be handled by custom transformer plug-ins.

Parameters
proxyTransformPaththe DAG path of the proxy shape
startPaththe path from which iteration needs to start in the UsdStage
Returns
the array of prims found that will need to be imported
bool AL::usdmaya::nodes::ProxyShape::isRequiredPath ( const SdfPath &  path) const
inline

returns true if the path is required for an imported schema prim

Parameters
paththe path to query
Returns
true if the path represents a prim that is required.
MObject AL::usdmaya::nodes::ProxyShape::makeUsdTransformChain ( const UsdPrim &  usdPrim,
MDagModifier &  modifier,
TransformReason  reason,
MDGModifier *  modifier2 = 0,
uint32_t *  createCount = 0 
)

constructs a single chain of transform nodes from the usdPrim to the root of this proxy shape.

Parameters
usdPrimthe leaf of the prim we wish to create
modifierwill store the changes as this path is constructed.
reasonthe reason why this path is being generated.
modifier2is specified, the modifier will end up containing a set of commands to switch the pushToPrim flags to true. (This has to be done after the transform has been created and initialized, otherwise the default maya values will be pushed in the UsdPrim, wiping out the values you just loaded)
createCountthe returned number of transforms that were created.
Returns
the MObject of the parent transform node for the usdPrim
void AL::usdmaya::nodes::ProxyShape::makeUsdTransforms ( const UsdPrim &  usdPrim,
MDagModifier &  modifier,
TransformReason  reason,
MDGModifier *  modifier2 = 0 
)

Will construct AL_usdmaya_Transform nodes for all of the prims from the specified usdPrim and down.

Parameters
usdPrimthe root for the transforms to be created
modifierthe modifier that will store the creation steps for the transforms
reasonthe reason for creating the transforms (use with selection, etc).
modifier2if specified, this will contain a set of commands that turn on the pushToPrim flag on the transform nodes. These flags need to be set after the transforms have been created
void AL::usdmaya::nodes::ProxyShape::removeUsdTransformChain ( const UsdPrim &  usdPrim,
MDagModifier &  modifier,
TransformReason  reason 
)

will destroy all of the AL_usdmaya_Transform nodes from the prim specified, up to the root (unless any of those transform nodes are in use by another imported prim).

Parameters
usdPrimthe leaf node in the chain of transforms we wish to remove
modifierwill store the changes as this path is constructed.
reasonthe reason why this path is being generated.
void AL::usdmaya::nodes::ProxyShape::removeUsdTransforms ( const UsdPrim &  usdPrim,
MDagModifier &  modifier,
TransformReason  reason 
)

Will destroy all AL_usdmaya_Transform nodes found underneath the prim (unless those nodes are required for another purpose).

Parameters
usdPrim
modifierthe modifier that will be filled with the instructions to delete the transform nodes
reasonAre we deleting selected transforms, or those that are required, or requested?
nodes::SchemaNodeRefDB& AL::usdmaya::nodes::ProxyShape::schemaDB ( )
inline

return a reference to the DB of schema prims imported via custom translators (used for variant switching)

Returns
a reference to the DB used for variant changes.
SdfPathVector& AL::usdmaya::nodes::ProxyShape::selectedPaths ( )
inline

returns the paths of the selected items within the proxy shape

Returns
the paths of the selected prims
void AL::usdmaya::nodes::ProxyShape::unloadMayaReferences ( )

unloads all maya references

Todo:
I think we could remove this now? The only place this is used is within the post load process to ensure we don't duplicate any references in the scene. This can probably be removed.

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