AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DgNodeHelper.h
1 #pragma once
2 #include "AL/maya/Common.h"
3 
4 #include "maya/MPlug.h"
5 #include "maya/MAngle.h"
6 #include "maya/MDistance.h"
7 #include "maya/MTime.h"
8 
9 #include <string>
10 #include <vector>
11 
12 #include "pxr/base/gf/half.h" //Just for convenient half support
13 
14 namespace AL {
15 namespace maya {
16 //----------------------------------------------------------------------------------------------------------------------
20 //----------------------------------------------------------------------------------------------------------------------
22 {
23 public:
24 
27 
29  virtual ~DgNodeHelper() {}
30 
31  //--------------------------------------------------------------------------------------------------------------------
33  //--------------------------------------------------------------------------------------------------------------------
34 
41  static MStatus getBoolArray(const MObject& node, const MObject& attr, std::vector<bool>& values);
42 
50  static MStatus getBoolArray(MObject node, MObject attr, bool* values, const size_t count);
51 
58  static MStatus getInt8Array(const MObject& node, const MObject& attr, std::vector<int8_t>& values);
59 
67  static MStatus getInt8Array(MObject node, MObject attr, int8_t* values, size_t count);
68 
75  static MStatus getInt16Array(const MObject& node, const MObject& attr, std::vector<int16_t>& values);
76 
84  static MStatus getInt16Array(MObject node, MObject attr, int16_t* values, size_t count);
85 
92  static MStatus getInt32Array(const MObject& node, const MObject& attr, std::vector<int32_t>& values);
93 
101  static MStatus getInt32Array(MObject node, MObject attr, int32_t* values, size_t count);
102 
109  static MStatus getInt64Array(const MObject& node, const MObject& attr, std::vector<int64_t>& values);
110 
118  static MStatus getInt64Array(MObject node, MObject attr, int64_t* values, size_t count);
119 
126  static MStatus getHalfArray(const MObject& node, const MObject& attr, std::vector<half>& values);
127 
135  static MStatus getHalfArray(MObject node, MObject attr, half* values, size_t count);
136 
143  static MStatus getFloatArray(const MObject& node, const MObject& attr, std::vector<float>& values);
144 
152  static MStatus getFloatArray(MObject node, MObject attr, float* values, size_t count);
153 
160  static MStatus getDoubleArray(const MObject& node, const MObject& attr, std::vector<double>& values);
161 
169  static MStatus getDoubleArray(MObject node, MObject attr, double* values, size_t count);
170 
177  static MStatus getVec2Array(MObject node, MObject attr, half* values, size_t count);
178 
185  static MStatus getVec2Array(MObject node, MObject attr, float* values, size_t count);
186 
193  static MStatus getVec2Array(MObject node, MObject attr, double* values, size_t count);
194 
201  static MStatus getVec2Array(MObject node, MObject attr, int32_t* values, size_t count);
202 
203 
210  static MStatus getVec3Array(MObject node, MObject attr, half* values, size_t count);
211 
218  static MStatus getVec3Array(MObject node, MObject attr, float* values, size_t count);
219 
226  static MStatus getVec3Array(MObject node, MObject attr, double* values, size_t count);
227 
234  static MStatus getVec3Array(MObject node, MObject attr, int32_t* values, size_t count);
235 
242  static MStatus getVec4Array(MObject node, MObject attr, half* values, size_t count);
243 
250  static MStatus getVec4Array(MObject node, MObject attr, float* values, size_t count);
251 
258  static MStatus getVec4Array(MObject node, MObject attr, double* values, size_t count);
259 
266  static MStatus getVec4Array(MObject node, MObject attr, int32_t* values, size_t count);
267 
274  static MStatus getQuatArray(MObject node, MObject attr, half* values, size_t count);
275 
282  static MStatus getQuatArray(MObject node, MObject attr, float* values, size_t count);
283 
290  static MStatus getQuatArray(MObject node, MObject attr, double* values, size_t count);
291 
298  static MStatus getMatrix2x2Array(MObject node, MObject attr, float* values, size_t count);
299 
306  static MStatus getMatrix2x2Array(MObject node, MObject attr, double* values, size_t count);
307 
314  static MStatus getMatrix3x3Array(MObject node, MObject attr, float* values, size_t count);
315 
322  static MStatus getMatrix3x3Array(MObject node, MObject attr, double* values, size_t count);
323 
330  static MStatus getMatrix4x4Array(MObject node, MObject attr, float* values, size_t count);
331 
338  static MStatus getMatrix4x4Array(MObject node, MObject attr, double* values, size_t count);
339 
348  static MStatus getTimeArray(MObject node, MObject attr, float* values, size_t count, MTime::Unit unit);
349 
358  static MStatus getAngleArray(MObject node, MObject attr, float* values, size_t count, MAngle::Unit unit);
359 
368  static MStatus getDistanceArray(MObject node, MObject attr, float* values, size_t count, MDistance::Unit unit);
369 
376  static MStatus getStringArray(MObject node, MObject attr, std::string* values, size_t count);
377 
378  //--------------------------------------------------------------------------------------------------------------------
380  //--------------------------------------------------------------------------------------------------------------------
381 
387  static MStatus getHalf(MObject node, MObject attr, half& value)
388  {
389  float f;
390  MStatus status = getFloat(node, attr, f);
391  value = f;
392  return status;
393  }
394 
400  static MStatus getFloat(MObject node, MObject attr, float& value);
401 
407  static MStatus getDouble(MObject node, MObject attr, double& value);
408 
414  static MStatus getTime(MObject node, MObject attr, MTime& value);
415 
421  static MStatus getDistance(MObject node, MObject attr, MDistance& value);
422 
428  static MStatus getAngle(MObject node, MObject attr, MAngle& value);
429 
435  static MStatus getBool(MObject node, MObject attr, bool& value);
436 
442  static MStatus getInt8(MObject node, MObject attr, int8_t& value);
443 
449  static MStatus getInt16(MObject node, MObject attr, int16_t& value);
450 
456  static MStatus getInt32(MObject node, MObject attr, int32_t& value);
457 
463  static MStatus getInt64(MObject node, MObject attr, int64_t& value);
464 
470  static MStatus getMatrix2x2(MObject node, MObject attr, float* values);
471 
477  static MStatus getMatrix3x3(MObject node, MObject attr, float* values);
478 
484  static MStatus getMatrix4x4(MObject node, MObject attr, float* values);
485 
491  static MStatus getMatrix4x4(MObject node, MObject attr, MFloatMatrix& values);
492 
498  static MStatus getMatrix2x2(MObject node, MObject attr, double* values);
499 
505  static MStatus getMatrix3x3(MObject node, MObject attr, double* values);
506 
512  static MStatus getMatrix4x4(MObject node, MObject attr, double* values);
513 
519  static MStatus getMatrix4x4(MObject node, MObject attr, MMatrix& values);
520 
526  static MStatus getString(MObject node, MObject attr, std::string& str);
527 
533  static MStatus getVec2(MObject node, MObject attr, int32_t* xy);
534 
540  static MStatus getVec2(MObject node, MObject attr, float* xy);
541 
547  static MStatus getVec2(MObject node, MObject attr, double* xy);
548 
554  static MStatus getVec2(MObject node, MObject attr, half* xy);
555 
561  static MStatus getVec3(MObject node, MObject attr, int32_t* xyz);
562 
568  static MStatus getVec3(MObject node, MObject attr, float* xyz);
569 
575  static MStatus getVec3(MObject node, MObject attr, double* xyz);
576 
582  static MStatus getVec3(MObject node, MObject attr, half* xyz);
583 
589  static MStatus getVec4(MObject node, MObject attr, int32_t* xyzw);
590 
596  static MStatus getVec4(MObject node, MObject attr, float* xyzw);
597 
603  static MStatus getVec4(MObject node, MObject attr, double* xyzw);
604 
610  static MStatus getVec4(MObject node, MObject attr, half* xyzw);
611 
617  static MStatus getQuat(MObject node, MObject attr, float* xyzw);
618 
624  static MStatus getQuat(MObject node, MObject attr, double* xyzw);
625 
631  static MStatus getQuat(MObject node, MObject attr, half* xyzw);
632 
633  //--------------------------------------------------------------------------------------------------------------------
635  //--------------------------------------------------------------------------------------------------------------------
636 
642  static MStatus setBoolArray(const MObject& node, const MObject& attr, const std::vector<bool>& values);
643 
650  static MStatus setBoolArray(MObject node, MObject attr, const bool* const values, size_t count);
651 
657  static MStatus setInt8Array(const MObject& node, const MObject& attr, const std::vector<int8_t>& values);
658 
665  static MStatus setInt8Array(MObject node, MObject attr, const int8_t* values, size_t count);
666 
672  static MStatus setInt16Array(const MObject& node, const MObject& attr, const std::vector<int16_t>& values);
673 
680  static MStatus setInt16Array(MObject node, MObject attr, const int16_t* values, size_t count);
681 
687  static MStatus setInt32Array(const MObject& node, const MObject& attr, const std::vector<int32_t>& values);
688 
695  static MStatus setInt32Array(MObject node, MObject attr, const int32_t* values, size_t count);
696 
702  static MStatus setInt64Array(const MObject& node, const MObject& attr, const std::vector<int64_t>& values);
703 
710  static MStatus setInt64Array(MObject node, MObject attr, const int64_t* values, size_t count);
711 
717  static MStatus setHalfArray(const MObject& node, const MObject& attr, const std::vector<half>& values);
718 
725  static MStatus setHalfArray(MObject node, MObject attr, const half* values, size_t count);
726 
732  static MStatus setFloatArray(const MObject& node, const MObject& attr, const std::vector<float>& values);
733 
740  static MStatus setFloatArray(MObject node, MObject attr, const float* values, size_t count);
741 
747  static MStatus setDoubleArray(const MObject& node, const MObject& attr, const std::vector<double>& values);
748 
755  static MStatus setDoubleArray(MObject node, MObject attr, const double* values, size_t count);
756 
757  static MStatus setVec2Array(MObject node, MObject attr, const half* values, size_t count);
758  static MStatus setVec2Array(MObject node, MObject attr, const float* values, size_t count);
759  static MStatus setVec2Array(MObject node, MObject attr, const double* values, size_t count);
760  static MStatus setVec2Array(MObject node, MObject attr, const int32_t* values, size_t count);
761 
762  static MStatus setVec3Array(MObject node, MObject attr, const half* values, size_t count);
763  static MStatus setVec3Array(MObject node, MObject attr, const float* values, size_t count);
764  static MStatus setVec3Array(MObject node, MObject attr, const double* values, size_t count);
765  static MStatus setVec3Array(MObject node, MObject attr, const int32_t* values, size_t count);
766 
767  static MStatus setVec4Array(MObject node, MObject attr, const half* values, size_t count);
768  static MStatus setVec4Array(MObject node, MObject attr, const float* values, size_t count);
769  static MStatus setVec4Array(MObject node, MObject attr, const double* values, size_t count);
770  static MStatus setVec4Array(MObject node, MObject attr, const int32_t* values, size_t count);
771 
772  static MStatus setQuatArray(MObject node, MObject attr, const half* values, size_t count);
773  static MStatus setQuatArray(MObject node, MObject attr, const float* values, size_t count);
774  static MStatus setQuatArray(MObject node, MObject attr, const double* values, size_t count);
775 
776  static MStatus setMatrix2x2Array(MObject node, MObject attr, const float* values, size_t count);
777  static MStatus setMatrix2x2Array(MObject node, MObject attr, const double* values, size_t count);
778  static MStatus setMatrix3x3Array(MObject node, MObject attr, const float* values, size_t count);
779  static MStatus setMatrix3x3Array(MObject node, MObject attr, const double* values, size_t count);
780  static MStatus setMatrix4x4Array(MObject node, MObject attr, const float* values, size_t count);
781  static MStatus setMatrix4x4Array(MObject node, MObject attr, const double* values, size_t count);
782 
783  static MStatus setStringArray(MObject node, MObject attr, const std::string* values, size_t count);
784 
785  static MStatus setTimeArray(MObject node, MObject attr, const float* values, size_t count, MTime::Unit unit);
786  static MStatus setAngleArray(MObject node, MObject attr, const float* values, size_t count, MAngle::Unit unit);
787  static MStatus setDistanceArray(MObject node, MObject attr, const float* values, size_t count, MDistance::Unit unit);
788 
789  //--------------------------------------------------------------------------------------------------------------------
791  //--------------------------------------------------------------------------------------------------------------------
792 
798  static MStatus setHalf(MObject node, MObject attr, const half value)
799  { return setFloat(node, attr, value); }
800 
806  static MStatus setFloat(MObject node, MObject attr, float value);
807 
813  static MStatus setDouble(MObject node, MObject attr, double value);
814 
820  static MStatus setTime(MObject node, MObject attr, MTime value);
821 
827  static MStatus setDistance(MObject node, MObject attr, MDistance value);
828 
834  static MStatus setAngle(MObject node, MObject attr, MAngle value);
835 
841  static MStatus setBool(MObject node, MObject attr, bool value);
842 
848  static MStatus setInt8(MObject node, MObject attr, int8_t value);
849 
855  static MStatus setInt16(MObject node, MObject attr, int16_t value);
856 
862  static MStatus setInt32(MObject node, MObject attr, int32_t value);
863 
869  static MStatus setInt64(MObject node, MObject attr, int64_t value);
870 
878  static MStatus setVec3(MObject node, MObject attr, float x, float y, float z);
879 
887  static MStatus setVec3(MObject node, MObject attr, double x, double y, double z);
888 
896  static MStatus setVec3(MObject node, MObject attr, MAngle x, MAngle y, MAngle z);
897 
903  static MStatus setMatrix2x2(MObject node, MObject attr, const float* values);
904 
910  static MStatus setMatrix3x3(MObject node, MObject attr, const float* values);
911 
917  static MStatus setMatrix4x4(MObject node, MObject attr, const float* values);
918 
924  static MStatus setMatrix4x4(MObject node, MObject attr, const MFloatMatrix& value);
925 
931  static MStatus setMatrix2x2(MObject node, MObject attr, const double* values);
932 
938  static MStatus setMatrix3x3(MObject node, MObject attr, const double* values);
939 
945  static MStatus setMatrix4x4(MObject node, MObject attr, const double* values);
946 
952  static MStatus setMatrix4x4(MObject node, MObject attr, const MMatrix& value);
953 
959  static MStatus setString(MObject node, MObject attr, const char* str);
960 
966  static MStatus setString(MObject node, MObject attr, const std::string& str);
967 
973  static MStatus setVec2(MObject node, MObject attr, const int32_t* xy);
974 
980  static MStatus setVec2(MObject node, MObject attr, const float* xy);
981 
987  static MStatus setVec2(MObject node, MObject attr, const double* xy);
988 
994  static MStatus setVec2(MObject node, MObject attr, const half* xy);
995 
1001  static MStatus setVec3(MObject node, MObject attr, const int32_t* xyz);
1002 
1008  static MStatus setVec3(MObject node, MObject attr, const float* xyz);
1009 
1015  static MStatus setVec3(MObject node, MObject attr, const double* xyz);
1016 
1022  static MStatus setVec3(MObject node, MObject attr, const half* xyz);
1023 
1029  static MStatus setVec4(MObject node, MObject attr, const int32_t* xyzw);
1030 
1036  static MStatus setVec4(MObject node, MObject attr, const float* xyzw);
1037 
1043  static MStatus setVec4(MObject node, MObject attr, const double* xyzw);
1044 
1050  static MStatus setVec4(MObject node, MObject attr, const half* xyzw);
1051 
1057  static MStatus setQuat(MObject node, MObject attr, const float* xyzw);
1058 
1064  static MStatus setQuat(MObject node, MObject attr, const double* xyzw);
1065 
1071  static MStatus setQuat(MObject node, MObject attr, const half* xyzw);
1072 
1073  //--------------------------------------------------------------------------------------------------------------------
1075  //--------------------------------------------------------------------------------------------------------------------
1076 
1084  static MStatus addStringValue(MObject node, const char* attrName, const char* stringValue);
1085 };
1086 
1087 //----------------------------------------------------------------------------------------------------------------------
1088 inline MStatus DgNodeHelper::getInt8Array(const MObject& node, const MObject& attr, std::vector<int8_t>& values)
1089 {
1090  MPlug plug(node, attr);
1091  if(!plug || !plug.isArray())
1092  return MS::kFailure;
1093  const uint32_t num = plug.numElements();
1094  values.resize(num);
1095  return getInt8Array(node, attr, values.data(), num);
1096 }
1097 
1098 //----------------------------------------------------------------------------------------------------------------------
1099 inline MStatus DgNodeHelper::getInt16Array(const MObject& node, const MObject& attr, std::vector<int16_t>& values)
1100 {
1101  MPlug plug(node, attr);
1102  if(!plug || !plug.isArray())
1103  return MS::kFailure;
1104  const uint32_t num = plug.numElements();
1105  values.resize(num);
1106  return getInt16Array(node, attr, values.data(), num);
1107 }
1108 
1109 //----------------------------------------------------------------------------------------------------------------------
1110 inline MStatus DgNodeHelper::getInt32Array(const MObject& node, const MObject& attr, std::vector<int32_t>& values)
1111 {
1112  MPlug plug(node, attr);
1113  if(!plug || !plug.isArray())
1114  return MS::kFailure;
1115  const uint32_t num = plug.numElements();
1116  values.resize(num);
1117  return getInt32Array(node, attr, values.data(), num);
1118 }
1119 
1120 //----------------------------------------------------------------------------------------------------------------------
1121 inline MStatus DgNodeHelper::getInt64Array(const MObject& node, const MObject& attr, std::vector<int64_t>& values)
1122 {
1123  MPlug plug(node, attr);
1124  if(!plug || !plug.isArray())
1125  return MS::kFailure;
1126  const uint32_t num = plug.numElements();
1127  values.resize(num);
1128  return getInt64Array(node, attr, values.data(), num);
1129 }
1130 
1131 //----------------------------------------------------------------------------------------------------------------------
1132 inline MStatus DgNodeHelper::getHalfArray(const MObject& node, const MObject& attr, std::vector<half>& values)
1133 {
1134  MPlug plug(node, attr);
1135  if(!plug || !plug.isArray())
1136  return MS::kFailure;
1137  const uint32_t num = plug.numElements();
1138  values.resize(num);
1139  return getHalfArray(node, attr, values.data(), num);
1140 }
1141 
1142 //----------------------------------------------------------------------------------------------------------------------
1143 inline MStatus DgNodeHelper::getFloatArray(const MObject& node, const MObject& attr, std::vector<float>& values)
1144 {
1145  MPlug plug(node, attr);
1146  if(!plug || !plug.isArray())
1147  return MS::kFailure;
1148  const uint32_t num = plug.numElements();
1149  values.resize(num);
1150  return getFloatArray(node, attr, values.data(), num);
1151 }
1152 
1153 //----------------------------------------------------------------------------------------------------------------------
1154 inline MStatus DgNodeHelper::getDoubleArray(const MObject& node, const MObject& attr, std::vector<double>& values)
1155 {
1156  MPlug plug(node, attr);
1157  if(!plug || !plug.isArray())
1158  return MS::kFailure;
1159  const uint32_t num = plug.numElements();
1160  values.resize(num);
1161  return getDoubleArray(node, attr, values.data(), num);
1162 }
1163 
1164 //----------------------------------------------------------------------------------------------------------------------
1165 inline MStatus DgNodeHelper::setInt8Array(const MObject& node, const MObject& attr, const std::vector<int8_t>& values)
1166 {
1167  return setInt8Array(node, attr, values.data(), values.size());
1168 }
1169 
1170 //----------------------------------------------------------------------------------------------------------------------
1171 inline MStatus DgNodeHelper::setInt16Array(const MObject& node, const MObject& attr, const std::vector<int16_t>& values)
1172 {
1173  return setInt16Array(node, attr, values.data(), values.size());
1174 }
1175 
1176 //----------------------------------------------------------------------------------------------------------------------
1177 inline MStatus DgNodeHelper::setInt32Array(const MObject& node, const MObject& attr, const std::vector<int32_t>& values)
1178 {
1179  return setInt32Array(node, attr, values.data(), values.size());
1180 }
1181 
1182 //----------------------------------------------------------------------------------------------------------------------
1183 inline MStatus DgNodeHelper::setInt64Array(const MObject& node, const MObject& attr, const std::vector<int64_t>& values)
1184 {
1185  return setInt64Array(node, attr, values.data(), values.size());
1186 }
1187 
1188 //----------------------------------------------------------------------------------------------------------------------
1189 inline MStatus DgNodeHelper::setHalfArray(const MObject& node, const MObject& attr, const std::vector<half>& values)
1190 {
1191  return setHalfArray(node, attr, values.data(), values.size());
1192 }
1193 
1194 //----------------------------------------------------------------------------------------------------------------------
1195 inline MStatus DgNodeHelper::setFloatArray(const MObject& node, const MObject& attr, const std::vector<float>& values)
1196 {
1197  return setFloatArray(node, attr, values.data(), values.size());
1198 }
1199 
1200 //----------------------------------------------------------------------------------------------------------------------
1201 inline MStatus DgNodeHelper::setDoubleArray(const MObject& node, const MObject& attr, const std::vector<double>& values)
1202 {
1203  return setDoubleArray(node, attr, values.data(), values.size());
1204 }
1205 
1206 //----------------------------------------------------------------------------------------------------------------------
1207 } // maya
1208 } // AL
1209 //----------------------------------------------------------------------------------------------------------------------
static MStatus setBool(MObject node, MObject attr, bool value)
sets a boolean value on the specified node/attribute
static MStatus getVec3(MObject node, MObject attr, int32_t *xyz)
extracts a 3D vector value from the specified node/attribute
static MStatus getDoubleArray(const MObject &node, const MObject &attr, std::vector< double > &values)
retrieve an array of double values from an attribute in Maya
Definition: DgNodeHelper.h:1154
static MStatus getMatrix4x4Array(MObject node, MObject attr, float *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 4x4 floating point matrix array ...
static MStatus setInt32(MObject node, MObject attr, int32_t value)
sets a 32bit integer value on the specified node/attribute
static MStatus setFloatArray(const MObject &node, const MObject &attr, const std::vector< float > &values)
sets all values on a float array attribute on the specified node
Definition: DgNodeHelper.h:1195
static MStatus setDistance(MObject node, MObject attr, MDistance value)
sets a distance value on the specified node/attribute
static MStatus getAngle(MObject node, MObject attr, MAngle &value)
extracts a single angle value from the specified node/attribute
static MStatus setInt32Array(const MObject &node, const MObject &attr, const std::vector< int32_t > &values)
sets all values on a 32bit integer array attribute on the specified node
Definition: DgNodeHelper.h:1177
static MStatus getInt16Array(const MObject &node, const MObject &attr, std::vector< int16_t > &values)
retrieve an array of 16bit integer values from an attribute in Maya
Definition: DgNodeHelper.h:1099
static MStatus setHalf(MObject node, MObject attr, const half value)
sets a half float value on the specified node/attribute
Definition: DgNodeHelper.h:798
static MStatus setString(MObject node, MObject attr, const char *str)
sets a string value on the specified node/attribute
static MStatus getQuat(MObject node, MObject attr, float *xyzw)
extracts a 4D quat value from the specified node/attribute
static MStatus getMatrix3x3(MObject node, MObject attr, float *values)
extracts a 3x3 matrix value from the specified node/attribute (as a float)
static MStatus setMatrix2x2(MObject node, MObject attr, const float *values)
sets a 2x2 matrix value on the specified node/attribute
static MStatus setAngle(MObject node, MObject attr, MAngle value)
sets an angle value on the specified node/attribute
static MStatus setDoubleArray(const MObject &node, const MObject &attr, const std::vector< double > &values)
sets all values on a double array attribute on the specified node
Definition: DgNodeHelper.h:1201
static MStatus getInt64(MObject node, MObject attr, int64_t &value)
extracts a single 64bit integer value from the specified node/attribute
static MStatus getMatrix2x2Array(MObject node, MObject attr, float *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 2x2 floating point matrix array ...
static MStatus getBoolArray(const MObject &node, const MObject &attr, std::vector< bool > &values)
retrieve an array of boolean values from an attribute in Maya
static MStatus getVec2Array(MObject node, MObject attr, half *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 2D half float array ...
static MStatus setInt16(MObject node, MObject attr, int16_t value)
sets a 16bit integer value on the specified node/attribute
static MStatus getMatrix4x4(MObject node, MObject attr, float *values)
extracts a 4x4 matrix value from the specified node/attribute (as a float)
static MStatus setBoolArray(const MObject &node, const MObject &attr, const std::vector< bool > &values)
sets all values on a boolean array attribute on the specified node
static MStatus getFloatArray(const MObject &node, const MObject &attr, std::vector< float > &values)
retrieve an array of float values from an attribute in Maya
Definition: DgNodeHelper.h:1143
static MStatus setVec3(MObject node, MObject attr, float x, float y, float z)
sets a 3D vector value on the specified node/attribute
static MStatus setInt64Array(const MObject &node, const MObject &attr, const std::vector< int64_t > &values)
sets all values on a 64bit integer array attribute on the specified node
Definition: DgNodeHelper.h:1183
static MStatus addStringValue(MObject node, const char *attrName, const char *stringValue)
adds a new strings attribute of the specified name to the specified node, and sets its value...
static MStatus getInt64Array(const MObject &node, const MObject &attr, std::vector< int64_t > &values)
retrieve an array of 64bit integer values from an attribute in Maya
Definition: DgNodeHelper.h:1121
static MStatus getTimeArray(MObject node, MObject attr, float *values, size_t count, MTime::Unit unit)
given MObjects for an attribute on a node, extract the data as an array of time values scale to the s...
static MStatus getAngleArray(MObject node, MObject attr, float *values, size_t count, MAngle::Unit unit)
given MObjects for an attribute on a node, extract the data as an array of angle values scale to the ...
Utility class that provides support for setting/getting attributes.
Definition: DgNodeHelper.h:21
static MStatus setInt8Array(const MObject &node, const MObject &attr, const std::vector< int8_t > &values)
sets all values on a 8bit integer array attribute on the specified node
Definition: DgNodeHelper.h:1165
static MStatus getVec2(MObject node, MObject attr, int32_t *xy)
extracts a 2D vector value from the specified node/attribute
static MStatus getDistanceArray(MObject node, MObject attr, float *values, size_t count, MDistance::Unit unit)
given MObjects for an attribute on a node, extract the data as an array of distance values scale to t...
static MStatus getInt8Array(const MObject &node, const MObject &attr, std::vector< int8_t > &values)
retrieve an array of 8 bit char values from an attribute in Maya
Definition: DgNodeHelper.h:1088
DgNodeHelper()
ctor
Definition: DgNodeHelper.h:26
static MStatus getHalf(MObject node, MObject attr, half &value)
extracts a single half float value from the specified node/attribute
Definition: DgNodeHelper.h:387
static MStatus getInt8(MObject node, MObject attr, int8_t &value)
extracts a single 8bit integer value from the specified node/attribute
static MStatus getHalfArray(const MObject &node, const MObject &attr, std::vector< half > &values)
retrieve an array of float values from an attribute in Maya (converted to halfs)
Definition: DgNodeHelper.h:1132
static MStatus setMatrix4x4(MObject node, MObject attr, const float *values)
sets a 4x4 matrix value on the specified node/attribute
static MStatus getStringArray(MObject node, MObject attr, std::string *values, size_t count)
given MObjects for an attribute on a node, extract the data as an array of string values ...
static MStatus getBool(MObject node, MObject attr, bool &value)
extracts a single boolean value from the specified node/attribute
static MStatus getDouble(MObject node, MObject attr, double &value)
extracts a single double value from the specified node/attribute
static MStatus getVec3Array(MObject node, MObject attr, half *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 3D half float array ...
static MStatus setVec4(MObject node, MObject attr, const int32_t *xyzw)
sets a 4D vector value on the specified node/attribute
static MStatus getTime(MObject node, MObject attr, MTime &value)
extracts a single time value from the specified node/attribute
virtual ~DgNodeHelper()
dtor
Definition: DgNodeHelper.h:29
static MStatus setDouble(MObject node, MObject attr, double value)
sets a double value on the specified node/attribute
static MStatus setInt64(MObject node, MObject attr, int64_t value)
sets a 64bit integer value on the specified node/attribute
static MStatus setInt8(MObject node, MObject attr, int8_t value)
sets a 8bit integer value on the specified node/attribute
static MStatus getString(MObject node, MObject attr, std::string &str)
extracts a string value from the specified node/attribute
static MStatus getVec4Array(MObject node, MObject attr, half *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 4D half float array ...
static MStatus setInt16Array(const MObject &node, const MObject &attr, const std::vector< int16_t > &values)
sets all values on a 16bit integer array attribute on the specified node
Definition: DgNodeHelper.h:1171
static MStatus setVec2(MObject node, MObject attr, const int32_t *xy)
sets a 2D vector value on the specified node/attribute
static MStatus getQuatArray(MObject node, MObject attr, half *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 4D half float array ...
static MStatus getMatrix3x3Array(MObject node, MObject attr, float *values, size_t count)
given MObjects for an attribute on a node, extract the data as a 3x3 floating point matrix array ...
static MStatus setMatrix3x3(MObject node, MObject attr, const float *values)
sets a 3x3 matrix value on the specified node/attribute
static MStatus setFloat(MObject node, MObject attr, float value)
sets a float value on the specified node/attribute
static MStatus getDistance(MObject node, MObject attr, MDistance &value)
extracts a single distance value from the specified node/attribute
static MStatus getInt32Array(const MObject &node, const MObject &attr, std::vector< int32_t > &values)
retrieve an array of 32bit integer values from an attribute in Maya
Definition: DgNodeHelper.h:1110
static MStatus getMatrix2x2(MObject node, MObject attr, float *values)
extracts a 2x2 matrix value from the specified node/attribute (as a float)
static MStatus setHalfArray(const MObject &node, const MObject &attr, const std::vector< half > &values)
sets all values on a float array attribute on the specified node (but convert from half float data) ...
Definition: DgNodeHelper.h:1189
static MStatus getFloat(MObject node, MObject attr, float &value)
extracts a single float value from the specified node/attribute
static MStatus getVec4(MObject node, MObject attr, int32_t *xyzw)
extracts a 4D vector value from the specified node/attribute
static MStatus setQuat(MObject node, MObject attr, const float *xyzw)
sets a 4D quat value on the specified node/attribute
static MStatus setTime(MObject node, MObject attr, MTime value)
sets a time value on the specified node/attribute
static MStatus getInt16(MObject node, MObject attr, int16_t &value)
extracts a single 16 bit integer value from the specified node/attribute
static MStatus getInt32(MObject node, MObject attr, int32_t &value)
extracts a single 32bit integer value from the specified node/attribute