24 #ifndef PXRUSDMAYA_TRANSLATOR_UTIL_H
25 #define PXRUSDMAYA_TRANSLATOR_UTIL_H
28 #include "usdMaya/api.h"
32 #include "pxr/usd/usd/prim.h"
34 #include <maya/MObject.h>
35 #include <maya/MString.h>
37 PXR_NAMESPACE_OPEN_SCOPE
39 enum class UsdMayaShadingNodeType {
66 MObject* mayaNodeObj);
84 MObject* mayaNodeObj);
93 const MString& nodeTypeName,
97 MObject* mayaNodeObj);
106 const MString& nodeTypeName,
110 MObject* mayaNodeObj);
119 const MString& nodeName,
120 const MString& nodeTypeName,
123 MObject* mayaNodeObj);
140 const MString& nodeName,
141 const MString& nodeTypeName,
142 const UsdMayaShadingNodeType shadingNodeType,
145 const MObject parentNode=MObject::kNullObj);
151 template <
typename APISchemaType>
154 if (!usdPrim.
HasAPI<APISchemaType>()) {
155 return APISchemaType::Apply(usdPrim);
158 return APISchemaType(usdPrim);
165 PXR_NAMESPACE_CLOSE_SCOPE
Provides helper functions for other readers to use.
static PXRUSDMAYA_API bool CreateDummyTransformNode(const UsdPrim &usdPrim, MObject &parentNode, bool importTypeName, const UsdMayaPrimReaderArgs &args, UsdMayaPrimReaderContext *context, MStatus *status, MObject *mayaNodeObj)
Creates a "dummy" transform node for the given prim, where the dummy transform has all transform prop...
static PXRUSDMAYA_API bool CreateNode(const UsdPrim &usdPrim, const MString &nodeTypeName, MObject &parentNode, UsdMayaPrimReaderContext *context, MStatus *status, MObject *mayaNodeObj)
Helper to create a node for usdPrim of type nodeTypeName under parentNode.
This class holds read-only arguments that are passed into reader plugins for the usdMaya library...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
A path value used to locate objects in layers or scenegraphs.
static PXRUSDMAYA_API bool CreateTransformNode(const UsdPrim &usdPrim, MObject &parentNode, const UsdMayaPrimReaderArgs &args, UsdMayaPrimReaderContext *context, MStatus *status, MObject *mayaNodeObj)
Often when creating a prim, we want to first create a Transform node.
static APISchemaType GetAPISchemaForAuthoring(const UsdPrim &usdPrim)
Gets an API schema of the requested type for the given usdPrim.
This class provides an interface for reader plugins to communicate state back to the core usd maya lo...
static PXRUSDMAYA_API bool CreateShaderNode(const MString &nodeName, const MString &nodeTypeName, const UsdMayaShadingNodeType shadingNodeType, MStatus *status, MObject *shaderObj, const MObject parentNode=MObject::kNullObj)
Helper to create shadingNodes.
bool HasAPI(const TfToken &instanceName=TfToken()) const
Return true if the UsdPrim has had an API schema represented by the C++ class type T applied to it th...