27 #ifndef PXRUSDMAYA_READUTIL_H
28 #define PXRUSDMAYA_READUTIL_H
30 #include "usdMaya/api.h"
33 #include "pxr/usd/sdf/attributeSpec.h"
34 #include "pxr/usd/usd/attribute.h"
36 #include <maya/MDGModifier.h>
37 #include <maya/MFnDependencyNode.h>
38 #include <maya/MObject.h>
39 #include <maya/MPlug.h>
43 PXR_NAMESPACE_OPEN_SCOPE
70 MFnDependencyNode& depNode,
71 const std::string& attrName,
72 const std::string& attrNiceName = std::string());
81 MFnDependencyNode& depNode,
82 const std::string& attrName,
83 const std::string& attrNiceName,
84 MDGModifier& modifier);
91 MFnDependencyNode& depNode,
92 const std::string& attrName,
93 const std::string& attrNiceName,
94 MDGModifier& modifier);
120 MDGModifier& modifier);
136 MDGModifier& modifier);
150 const MObject& mayaObject);
161 const MObject& mayaObject);
168 template <
typename T>
169 static size_t ReadSchemaAttributesFromPrim(
171 const MObject& mayaObject,
172 const std::vector<TfToken>& attributeNames,
175 return ReadSchemaAttributesFromPrim(
191 static size_t ReadSchemaAttributesFromPrim(
193 const MObject& mayaObject,
195 const std::vector<TfToken>& attributeNames,
201 PXR_NAMESPACE_CLOSE_SCOPE
static PXRUSDMAYA_API bool ReadMetadataFromPrim(const TfToken::Set &includeMetadataKeys, const UsdPrim &prim, const MObject &mayaObject)
Reads the metadata specified in includeMetadataKeys from prim, and uses adaptors to write them onto a...
static PXRUSDMAYA_API bool ReadAPISchemaAttributesFromPrim(const TfToken::Set &includeAPINames, const UsdPrim &prim, const MObject &mayaObject)
Reads the attributes from the non-excluded schemas applied to prim, and uses adaptors to write them o...
static PXRUSDMAYA_API MObject FindOrCreateMayaAttr(const SdfValueTypeName &typeName, const SdfVariability variability, MFnDependencyNode &depNode, const std::string &attrName, const std::string &attrNiceName=std::string())
Given the typeName and variability, try to create a Maya attribute on depNode with the name attrName...
Represents a value type name, i.e.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Token for efficient comparison, assignment, and hashing of known strings.
std::set< TfToken, TfTokenFastArbitraryLessThan > Set
Predefined type for set of tokens, for when faster lookup is desired, without paying the memory or in...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
static PXRUSDMAYA_API bool SetMayaAttr(MPlug &attrPlug, const UsdAttribute &usdAttr)
Sets a Maya plug using the value on a USD attribute at default time.
SdfVariability
An enum that identifies variability types for attributes.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
static PXRUSDMAYA_API bool ReadFloat2AsUV()
Returns whether the environment setting for reading Float2 types as UV sets is set to true...
static PXRUSDMAYA_API void SetMayaAttrKeyableState(MPlug &attrPlug, const SdfVariability variability)
Sets the plug's keyable state based on whether the variability is varying or uniform.
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
TfType represents a dynamic runtime type.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
This struct contains helpers for reading USD (thus writing Maya data).