2 #include "AL/maya/SIMD.h"
3 #include "AL/usdmaya/Common.h"
5 #include "maya/MObject.h"
6 #include "maya/MString.h"
7 #include "maya/MUuid.h"
8 #include "maya/MFnDependencyNode.h"
26 void mapUsdPrimToMayaNode(
const UsdPrim& usdPrim,
const MObject& mayaObject,
const MDagPath*
const proxyShapeNode =
nullptr);
36 void matrixToSRT(GfMatrix4d& value,
double S[3], MEulerRotation& R,
double T[3]);
44 inline MString
convert(
const std::string& str)
46 return MString(str.data(), str.size());
55 inline std::string
convert(
const MString& str)
57 return std::string(str.asChar(), str.length());
71 #if AL_MAYA_ENABLE_SIMD
77 inline bool operator () (
const i128 a,
const i128 b)
const
79 const uint32_t lt_mask = movemask16i8(cmplt16i8(a, b));
80 const uint32_t eq_mask = 0xFFFF & (~movemask16i8(cmpeq16i8(a, b)));
81 if(!eq_mask)
return false;
84 const uint32_t index = __builtin_ctz(eq_mask);
86 return (lt_mask & (1 << index)) != 0;
102 for(
int i = 0; i < 16; ++i)
104 if(a.
uuid[i] < b.
uuid[i])
return true;
105 if(a.
uuid[i] > b.
uuid[i])
return false;
122 inline bool insert(
const MFnDependencyNode& fn)
124 #if AL_MAYA_ENABLE_SIMD
130 fn.
uuid().get(uuid.uuid);
131 bool contains = m_nodeMap.find(sse) != m_nodeMap.end();
133 m_nodeMap.insert(std::make_pair(sse, fn.object()));
137 bool contains = m_nodeMap.find(uuid) != m_nodeMap.end();
139 m_nodeMap.insert(std::make_pair(uuid, fn.object()));
149 #if AL_MAYA_ENABLE_SIMD
155 fn.
uuid().get(uuid.uuid);
156 bool contains = m_nodeMap.find(sse) != m_nodeMap.end();
160 bool contains = m_nodeMap.find(uuid) != m_nodeMap.end();
166 #if AL_MAYA_ENABLE_SIMD
167 std::map<i128, MObject, guid_compare> m_nodeMap;
169 std::map<guid, MObject, guid_compare> m_nodeMap;
uint8_t uuid[16]
the UUID for a Maya node
Definition: Utils.h:68
bool contains(const MFnDependencyNode &fn)
returns true if the dependency node is in the map
Definition: Utils.h:147
void mapUsdPrimToMayaNode(const UsdPrim &usdPrim, const MObject &mayaObject, const MDagPath *const proxyShapeNode=nullptr)
Captures the mapping of UsdPrim -> Maya Object and stores it into the session layer. usdMayaShapeNode is an optional argument, if it is passed and the passed in mayaObject's path couldnt be determined, then the corresponding maya path is determined using this AL::usdmaya::nodes::ProxyShape and the usdPrim path. It is to get around the delayed creation of nodes using a Modifier.
A type to store a UUID from a maya node.
Definition: Utils.h:66
bool insert(const MFnDependencyNode &fn)
insert a node into the map.
Definition: Utils.h:122
std::string convert(const MString &str)
convert string types
Definition: Utils.h:55
A class that acts as a lookup table for dependency nodes. It works by storing a sorted map based on t...
Definition: Utils.h:117
void matrixToSRT(GfMatrix4d &value, double S[3], MEulerRotation &R, double T[3])
convert a 4x4 matrix to an SRT transformation. Assumes that there is no shearing. ...
Less than comparison utility for sorting via 128bit guid.
Definition: Utils.h:94
bool operator()(const guid &a, const guid &b) const
performs a less than comparison between two UUIDs. Used to sort the entries in an MObjectMap ...
Definition: Utils.h:100