2 #include "AL/maya/Common.h"
4 #include "maya/MFnNumericAttribute.h"
5 #include "maya/MFnData.h"
6 #include "maya/MTypeId.h"
7 #include "maya/MColor.h"
8 #include "maya/MFloatPoint.h"
9 #include "maya/MFloatVector.h"
48 #define AL_DECL_ATTRIBUTE(XX) \
50 static MObject m_##XX; \
52 MPlug XX##Plug() const { return MPlug( thisMObject(), m_##XX ); } \
53 static const MObject& XX () { return m_##XX; }
177 #ifndef AL_GENERATING_DOCS
180 Frame(
const char* frameTitle)
181 : m_title(frameTitle) {}
188 kDirPathWithFiles = 2,
190 kMultiLoadFilePath = 4,
195 std::vector<AttributeUiType> m_attributeTypes;
196 std::vector<std::string> m_attributes;
197 std::vector<std::string> m_fileFilters;
202 std::string m_typeBeingRegistered;
203 std::vector<std::string> m_baseTemplates;
204 std::deque<Frame> m_frames;
206 static InternalData* m_internal;
224 static bool inputBoolValue(MDataBlock& dataBlock,
const MObject& attribute);
231 static int8_t
inputInt8Value(MDataBlock& dataBlock,
const MObject& attribute);
238 static int16_t
inputInt16Value(MDataBlock& dataBlock,
const MObject& attribute);
245 static int32_t
inputInt32Value(MDataBlock& dataBlock,
const MObject& attribute);
252 static int64_t
inputInt64Value(MDataBlock& dataBlock,
const MObject& attribute);
259 static float inputFloatValue(MDataBlock& dataBlock,
const MObject& attribute);
266 static double inputDoubleValue(MDataBlock& dataBlock,
const MObject& attribute);
273 static MMatrix
inputMatrixValue(MDataBlock& dataBlock,
const MObject& attribute);
280 static MPoint
inputPointValue(MDataBlock& dataBlock,
const MObject& attribute);
294 static MVector
inputVectorValue(MDataBlock& dataBlock,
const MObject& attribute);
301 static MTime
inputTimeValue(MDataBlock& dataBlock,
const MObject& attribute);
315 static MColor
inputColourValue(MDataBlock& dataBlock,
const MObject& attribute);
322 static MString
inputStringValue(MDataBlock& dataBlock,
const MObject& attribute);
330 static MPxData*
inputDataValue(MDataBlock& dataBlock,
const MObject& attribute);
337 template<
typename MPxDataType>
338 static MPxDataType*
inputDataValue(MDataBlock& dataBlock,
const MObject& attribute)
343 return dynamic_cast<MPxDataType*
>(data);
355 static MStatus
outputBoolValue(MDataBlock& dataBlock,
const MObject& attribute,
bool value);
362 static MStatus
outputInt8Value(MDataBlock& dataBlock,
const MObject& attribute, int8_t value);
369 static MStatus
outputInt16Value(MDataBlock& dataBlock,
const MObject& attribute, int16_t value);
376 static MStatus
outputInt32Value(MDataBlock& dataBlock,
const MObject& attribute, int32_t value);
383 static MStatus
outputInt64Value(MDataBlock& dataBlock,
const MObject& attribute, int64_t value);
390 static MStatus
outputFloatValue(MDataBlock& dataBlock,
const MObject& attribute,
float value);
397 static MStatus
outputDoubleValue(MDataBlock& dataBlock,
const MObject& attribute,
double value);
404 static MStatus
outputMatrixValue(MDataBlock& dataBlock,
const MObject& attribute,
const MMatrix& value);
411 static MStatus
outputPointValue(MDataBlock& dataBlock,
const MObject& attribute,
const MPoint& value);
418 static MStatus
outputFloatPointValue(MDataBlock& dataBlock,
const MObject& attribute,
const MFloatPoint& value);
425 static MStatus
outputVectorValue(MDataBlock& dataBlock,
const MObject& attribute,
const MVector& value);
432 static MStatus
outputEulerValue(MDataBlock& dataBlock,
const MObject& attribute,
const MEulerRotation& value);
439 static MStatus
outputFloatVectorValue(MDataBlock& dataBlock,
const MObject& attribute,
const MFloatVector& value);
446 static MStatus
outputColourValue(MDataBlock& dataBlock,
const MObject& attribute,
const MColor& value);
453 static MStatus
outputStringValue(MDataBlock& dataBlock,
const MObject& attribute,
const MString& value);
460 static MStatus
outputTimeValue(MDataBlock& dataBlock,
const MObject& attribute,
const MTime& value);
467 static MStatus
outputDataValue(MDataBlock& dataBlock,
const MObject& attribute, MPxData* value);
473 static MPxData*
createData(
const MTypeId& dataTypeId, MObject& data);
479 template<
typename MPxDataType>
480 static MPxDataType*
createData(
const MTypeId& dataTypeId, MObject& data)
483 return static_cast<MPxDataType*
>(ptr);
526 static void addFrame(
const char* frameTitle);
533 static MObject
addCompoundAttr(
const char* longName,
const char* shortName, uint32_t flags, std::initializer_list<MObject> list);
542 static MObject
addEnumAttr(
const char* longName,
const char* shortName, uint32_t flags,
const char*
const* strings,
const int16_t* values);
550 static MObject
addStringAttr(
const char* longName,
const char* shortName, uint32_t flags,
bool forceShow =
false);
560 static MObject
addFilePathAttr(
const char* longName,
const char* shortName, uint32_t flags,
FileMode fileMode,
const char* fileFilter =
"");
568 static MObject
addInt8Attr(
const char* longName,
const char* shortName, int8_t defaultValue, uint32_t flags);
576 static MObject
addInt16Attr(
const char* longName,
const char* shortName, int16_t defaultValue, uint32_t flags);
584 static MObject
addInt32Attr(
const char* longName,
const char* shortName, int32_t defaultValue, uint32_t flags);
592 static MObject
addInt64Attr(
const char* longName,
const char* shortName, int64_t defaultValue, uint32_t flags);
600 static MObject
addFloatAttr(
const char* longName,
const char* shortName,
float defaultValue, uint32_t flags);
608 static MObject
addDoubleAttr(
const char* longName,
const char* shortName,
double defaultValue, uint32_t flags);
616 static MObject
addTimeAttr(
const char* longName,
const char* shortName,
const MTime& defaultValue, uint32_t flags);
624 static MObject
addDistanceAttr(
const char* longName,
const char* shortName,
const MDistance& defaultValue, uint32_t flags);
632 static MObject
addAngleAttr(
const char* longName,
const char* shortName,
const MAngle& defaultValue, uint32_t flags);
640 static MObject
addBoolAttr(
const char* longName,
const char* shortName,
bool defaultValue, uint32_t flags);
650 static MObject
addFloat3Attr(
const char* longName,
const char* shortName,
float defaultX,
float defaultY,
float defaultZ, uint32_t flags);
660 static MObject
addAngle3Attr(
const char* longName,
const char* shortName,
float defaultX,
float defaultY,
float defaultZ, uint32_t flags);
669 static MObject
addDistance3Attr(
const char* longName,
const char* shortName,
float defaultX,
float defaultY,
float defaultZ, uint32_t flags);
677 static MObject
addPointAttr(
const char* longName,
const char* shortName,
const MPoint& defaultValue, uint32_t flags);
685 static MObject
addFloatPointAttr(
const char* longName,
const char* shortName,
const MFloatPoint& defaultValue, uint32_t flags)
686 {
return addFloat3Attr(longName, shortName, defaultValue.x, defaultValue.y, defaultValue.z, flags); }
694 static MObject
addVectorAttr(
const char* longName,
const char* shortName,
const MVector& defaultValue, uint32_t flags);
702 static MObject
addFloatVectorAttr(
const char* longName,
const char* shortName,
const MFloatVector& defaultValue, uint32_t flags)
703 {
return addFloat3Attr(longName, shortName, defaultValue.x, defaultValue.y, defaultValue.z, flags); }
711 static MObject
addColourAttr(
const char* longName,
const char* shortName,
const MColor& defaultValue, uint32_t flags)
712 {
return addFloat3Attr(longName, shortName, defaultValue.r, defaultValue.g, defaultValue.b, flags |
kColour); }
720 static MObject
addMatrix2x2Attr(
const char* longName,
const char* shortName,
const float defaultValue[2][2], uint32_t flags);
728 static MObject
addMatrix3x3Attr(
const char* longName,
const char* shortName,
const float defaultValue[3][3], uint32_t flags);
736 static MObject
addMatrixAttr(
const char* longName,
const char* shortName,
const MMatrix& defaultValue, uint32_t flags);
745 static MObject
addDataAttr(
const char* longName,
const char* shortName, MFnData::Type type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour = MFnAttribute::kNothing);
754 static MObject
addDataAttr(
const char* longName,
const char* shortName,
const MTypeId& type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour = MFnAttribute::kNothing);
761 static MObject
addMessageAttr(
const char* longName,
const char* shortName, uint32_t flags);
768 static MObject
addVec2hAttr(
const char* longName,
const char* shortName, uint32_t flags)
776 static MObject
addVec2fAttr(
const char* longName,
const char* shortName, uint32_t flags);
783 static MObject
addVec2iAttr(
const char* longName,
const char* shortName, uint32_t flags);
790 static MObject
addVec2dAttr(
const char* longName,
const char* shortName, uint32_t flags);
797 static MObject
addVec3hAttr(
const char* longName,
const char* shortName, uint32_t flags)
805 static MObject
addVec3fAttr(
const char* longName,
const char* shortName, uint32_t flags);
812 static MObject
addVec3iAttr(
const char* longName,
const char* shortName, uint32_t flags);
819 static MObject
addVec3dAttr(
const char* longName,
const char* shortName, uint32_t flags);
826 static MObject
addVec4hAttr(
const char* longName,
const char* shortName, uint32_t flags)
834 static MObject
addVec4fAttr(
const char* longName,
const char* shortName, uint32_t flags);
841 static MObject
addVec4iAttr(
const char* longName,
const char* shortName, uint32_t flags);
848 static MObject
addVec4dAttr(
const char* longName,
const char* shortName, uint32_t flags);
854 template<
typename datatype>
855 static void setMinMax(MObject obj, datatype minimum, datatype maximum)
857 MFnNumericAttribute fn(obj);
868 template<
typename datatype>
869 static void setMinMax(MObject obj, datatype minimum, datatype maximum, datatype softmin, datatype softmax)
871 MFnNumericAttribute fn(obj);
874 fn.setSoftMin(softmin);
875 fn.setSoftMax(softmax);
883 if(!baseTemplate.empty())
884 m_internal->m_baseTemplates.push_back(baseTemplate);
904 static MStatus
addStringAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags,
bool forceShow =
false, MObject* attribute = 0);
916 static MStatus
addFilePathAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags,
FileMode fileMode,
const char* fileFilter =
"", MObject* attribute = 0);
926 static MStatus
addInt8Attr(
const MObject& node,
const char* longName,
const char* shortName, int8_t defaultValue, uint32_t flags, MObject* attribute = 0);
936 static MStatus
addInt16Attr(
const MObject& node,
const char* longName,
const char* shortName, int16_t defaultValue, uint32_t flags, MObject* attribute = 0);
946 static MStatus
addInt32Attr(
const MObject& node,
const char* longName,
const char* shortName, int32_t defaultValue, uint32_t flags, MObject* attribute = 0);
956 static MStatus
addInt64Attr(
const MObject& node,
const char* longName,
const char* shortName, int64_t defaultValue, uint32_t flags, MObject* attribute = 0);
966 static MStatus
addFloatAttr(
const MObject& node,
const char* longName,
const char* shortName,
float defaultValue, uint32_t flags, MObject* attribute = 0);
976 static MStatus
addDoubleAttr(
const MObject& node,
const char* longName,
const char* shortName,
double defaultValue, uint32_t flags, MObject* attribute = 0);
986 static MStatus
addTimeAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MTime& defaultValue, uint32_t flags, MObject* attribute = 0);
996 static MStatus
addDistanceAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MDistance& defaultValue, uint32_t flags, MObject* attribute = 0);
1006 static MStatus
addAngleAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MAngle& defaultValue, uint32_t flags, MObject* attribute = 0);
1016 static MStatus
addBoolAttr(
const MObject& node,
const char* longName,
const char* shortName,
bool defaultValue, uint32_t flags, MObject* attribute = 0);
1027 static MStatus
addFloat3Attr(
const MObject& node,
const char* longName,
const char* shortName,
float defaultX,
float defaultY,
float defaultZ, uint32_t flags, MObject* attribute = 0);
1038 static MStatus
addAngle3Attr(
const MObject& node,
const char* longName,
const char* shortName,
float defaultX,
float defaultY,
float defaultZ, uint32_t flags, MObject* attribute = 0);
1048 static MStatus
addPointAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MPoint& defaultValue, uint32_t flags, MObject* attribute = 0);
1058 static MStatus
addFloatPointAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MFloatPoint& defaultValue, uint32_t flags, MObject* attribute = 0)
1059 {
return addFloat3Attr(node, longName, shortName, defaultValue.x, defaultValue.y, defaultValue.z, flags, attribute); }
1069 static MStatus
addVectorAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MVector& defaultValue, uint32_t flags, MObject* attribute = 0);
1079 static MStatus
addFloatVectorAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MFloatVector& defaultValue, uint32_t flags, MObject* attribute = 0)
1080 {
return addFloat3Attr(node, longName, shortName, defaultValue.x, defaultValue.y, defaultValue.z, flags); }
1090 static MStatus
addColourAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MColor& defaultValue, uint32_t flags, MObject* attribute = 0)
1091 {
return addFloat3Attr(node, longName, shortName, defaultValue.r, defaultValue.g, defaultValue.b, flags |
kColour, attribute); }
1101 static MStatus
addMatrixAttr(
const MObject& node,
const char* longName,
const char* shortName,
const MMatrix& defaultValue, uint32_t flags, MObject* attribute = 0);
1111 static MStatus
addMatrix2x2Attr(
const MObject& node,
const char* longName,
const char* shortName,
const float defaultValue[2][2], uint32_t flags, MObject* attribute = 0);
1121 static MStatus
addMatrix3x3Attr(
const MObject& node,
const char* longName,
const char* shortName,
const float defaultValue[3][3], uint32_t flags, MObject* attribute = 0);
1132 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);
1143 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);
1152 static MStatus
addMessageAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1161 static MStatus
addVec2hAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0)
1162 {
return addVec2fAttr(node, longName, shortName, flags); }
1171 static MStatus
addVec2fAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1180 static MStatus
addVec2iAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1189 static MStatus
addVec2dAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1198 static MStatus
addVec3hAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0)
1199 {
return addVec3fAttr(node, longName, shortName, flags, attribute); }
1208 static MStatus
addVec3fAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1217 static MStatus
addVec3iAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1226 static MStatus
addVec3dAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1235 static MStatus
addVec4hAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0)
1236 {
return addVec4fAttr(node, longName, shortName, flags, attribute); }
1245 static MStatus
addVec4fAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1254 static MStatus
addVec4iAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1263 static MStatus
addVec4dAttr(
const MObject& node,
const char* longName,
const char* shortName, uint32_t flags, MObject* attribute = 0);
1266 static MStatus applyAttributeFlags(MFnAttribute& fn, uint32_t flags);
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
static void addFrame(const char *frameTitle)
Add a new frame control into the AE template.
static int32_t inputInt32Value(MDataBlock &dataBlock, const MObject &attribute)
get an input 32 bit integer value from the dataBlock from the specified attribute ...
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.
static MObject addVec3hAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 3D vector attribute to this node type.
Definition: NodeHelper.h:797
static MObject addFloatAttr(const char *longName, const char *shortName, float defaultValue, uint32_t flags)
add a new floating point attribute to this node type.
static MStatus outputTimeValue(MDataBlock &dataBlock, const MObject &attribute, const MTime &value)
Set the output value of the specified attribute in the datablock.
static int64_t inputInt64Value(MDataBlock &dataBlock, const MObject &attribute)
get an input 64 bit integer value from the dataBlock from the specified attribute ...
static MObject addVec3dAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 3D vector attribute to this node type.
static MObject addDistanceAttr(const char *longName, const char *shortName, const MDistance &defaultValue, uint32_t flags)
add a new time attribute to this node type.
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.
Definition: NodeHelper.h:1079
The array can be resized via an array data builder.
Definition: NodeHelper.h:503
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
the attribute affects the appearance of a shape
Definition: NodeHelper.h:495
static bool inputBoolValue(MDataBlock &dataBlock, const MObject &attribute)
get an input boolean value from the dataBlock from the specified attribute
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.
Definition: NodeHelper.h:1198
a directory dialog
Definition: NodeHelper.h:514
static MObject addMessageAttr(const char *longName, const char *shortName, uint32_t flags)
add a new message attribute to this node type.
The attribute can be animated.
Definition: NodeHelper.h:496
static MObject addVec4fAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 4D vector attribute to this node type.
prevent the attribute from being added to the current node type
Definition: NodeHelper.h:504
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.
Definition: NodeHelper.h:685
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.
static MStatus outputDoubleValue(MDataBlock &dataBlock, const MObject &attribute, double value)
Set the output value of the specified attribute in the datablock.
a save file dialog
Definition: NodeHelper.h:511
static MObject addVec2iAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 2D vector attribute to this node type.
static MStatus outputPointValue(MDataBlock &dataBlock, const MObject &attribute, const MPoint &value)
Set the output value of the specified attribute in the datablock.
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.
Definition: NodeHelper.h:1235
static MStatus outputInt8Value(MDataBlock &dataBlock, const MObject &attribute, int8_t value)
Set the output value of the specified attribute in the datablock.
static int16_t inputInt16Value(MDataBlock &dataBlock, const MObject &attribute)
get an input 16 bit integer value from the dataBlock from the specified attribute ...
static MFloatVector inputFloatVectorValue(MDataBlock &dataBlock, const MObject &attribute)
get an input vector value from the dataBlock from the specified attribute
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.
Definition: NodeHelper.h:702
The attribute should be cached.
Definition: NodeHelper.h:491
static MObject addInt32Attr(const char *longName, const char *shortName, int32_t defaultValue, uint32_t flags)
add a new integer attribute to this node type.
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.
Definition: NodeHelper.h:1161
multiple input files
Definition: NodeHelper.h:515
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.
static MObject addVec4hAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 4D vector attribute to this node type.
Definition: NodeHelper.h:826
static MStatus outputStringValue(MDataBlock &dataBlock, const MObject &attribute, const MString &value)
Set the output value of the specified attribute in the datablock.
static MObject addDoubleAttr(const char *longName, const char *shortName, double defaultValue, uint32_t flags)
add a new double attribute to this node type.
static MObject addTimeAttr(const char *longName, const char *shortName, const MTime &defaultValue, uint32_t flags)
add a new time attribute to this node type.
static MStatus outputColourValue(MDataBlock &dataBlock, const MObject &attribute, const MColor &value)
Set the output value of the specified attribute in the datablock.
static MObject addPointAttr(const char *longName, const char *shortName, const MPoint &defaultValue, uint32_t flags)
add a new point attribute to this node type.
static MObject addVec3fAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 3D vector attribute to this node type.
static void generateAETemplate()
This method will construct up the MEL script code for the attribute editor template for your node...
FileMode
Specify the type of file/dir path when adding file path attributes. See addFilePathAttr.
Definition: NodeHelper.h:509
static MStatus outputFloatValue(MDataBlock &dataBlock, const MObject &attribute, float value)
Set the output value of the specified attribute in the datablock.
static MStatus outputVectorValue(MDataBlock &dataBlock, const MObject &attribute, const MVector &value)
Set the output value of the specified attribute in the datablock.
static MObject addVec2hAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 2D vector attribute to this node type.
Definition: NodeHelper.h:768
static MVector inputVectorValue(MDataBlock &dataBlock, const MObject &attribute)
get an input vector value from the dataBlock from the specified attribute
static MObject addMatrixAttr(const char *longName, const char *shortName, const MMatrix &defaultValue, uint32_t flags)
add a new matrix attribute to this node type.
static MColor inputColourValue(MDataBlock &dataBlock, const MObject &attribute)
get an input colour value from the dataBlock from the specified attribute
static void setNodeType(const MString &typeName)
Sets the node type name you are adding attributes. Please call this before adding any frames! ...
static MObject addVec3iAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 3D vector attribute to this node type.
static MMatrix inputMatrixValue(MDataBlock &dataBlock, const MObject &attribute)
get an input matrix value from the dataBlock from the specified attribute
static MObject addAngleAttr(const char *longName, const char *shortName, const MAngle &defaultValue, uint32_t flags)
add a new time attribute to this node type.
static MStatus outputInt32Value(MDataBlock &dataBlock, const MObject &attribute, int32_t value)
Set the output value of the specified attribute in the datablock.
static MObject addVec4dAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 4D vector attribute to this node type.
static void addBaseTemplate(const std::string &baseTemplate)
used to add additional references to AETemplate calls for standard types, e.g. "AEsurfaceShapeTemplat...
Definition: NodeHelper.h:881
static MStatus outputEulerValue(MDataBlock &dataBlock, const MObject &attribute, const MEulerRotation &value)
Set the output value of the specified attribute in the datablock.
static MObject addStringAttr(const char *longName, const char *shortName, uint32_t flags, bool forceShow=false)
add a new string attribute to this node type.
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.
Definition: NodeHelper.h:1058
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.
The attribute affects the world space matrix of a custom transform node.
Definition: NodeHelper.h:502
static MObject addVectorAttr(const char *longName, const char *shortName, const MVector &defaultValue, uint32_t flags)
add a new vector attribute to this node type.
static MObject addInt16Attr(const char *longName, const char *shortName, int16_t defaultValue, uint32_t flags)
add a new integer attribute to this node type.
static MObject addInt64Attr(const char *longName, const char *shortName, int64_t defaultValue, uint32_t flags)
add a new integer attribute to this node type.
static MObject addInt8Attr(const char *longName, const char *shortName, int8_t defaultValue, uint32_t flags)
add a new integer attribute to this node type.
static MPoint inputPointValue(MDataBlock &dataBlock, const MObject &attribute)
get an input point value from the dataBlock from the specified attribute
The attribute should be writable (input)
Definition: NodeHelper.h:493
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.
static void setMinMax(MObject obj, datatype minimum, datatype maximum, datatype softmin, datatype softmax)
set the min/max/softmax values on a numeric attribute
Definition: NodeHelper.h:869
~NodeHelper()
dtor
Definition: NodeHelper.h:215
The attribute value will be stored as a member variable, and getInternalValueInContext / setInternalV...
Definition: NodeHelper.h:501
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.
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.
The attribute is hidden.
Definition: NodeHelper.h:500
AttributeFlags
A set of bit flags you can apply to an attribute.
Definition: NodeHelper.h:489
a directory dialog, but displays files.
Definition: NodeHelper.h:513
static MFloatPoint inputFloatPointValue(MDataBlock &dataBlock, const MObject &attribute)
get an input point value from the dataBlock from the specified attribute
The attribute is a dynamic attribute added at runtime (and not during a plug-in node initialization) ...
Definition: NodeHelper.h:505
static MObject addVec2dAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 2D vector attribute to this node type.
NodeHelper()
ctor
Definition: NodeHelper.h:212
static MStatus outputInt16Value(MDataBlock &dataBlock, const MObject &attribute, int16_t value)
Set the output value of the specified attribute in the datablock.
static MObject addBoolAttr(const char *longName, const char *shortName, bool defaultValue, uint32_t flags)
add a new boolean attribute to this node type.
static MObject addVec4iAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 4D vector attribute to this node type.
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.
Definition: NodeHelper.h:1090
static MPxData * inputDataValue(MDataBlock &dataBlock, const MObject &attribute)
get an input data value from the dataBlock from the specified attribute
static float inputFloatValue(MDataBlock &dataBlock, const MObject &attribute)
get an input float value from the dataBlock from the specified attribute
static MObject addVec2fAttr(const char *longName, const char *shortName, uint32_t flags)
add a new 2D vector attribute to this node type.
static MStatus outputDataValue(MDataBlock &dataBlock, const MObject &attribute, MPxData *value)
Set the output value of the specified attribute in the datablock.
static MObject addColourAttr(const char *longName, const char *shortName, const MColor &defaultValue, uint32_t flags)
add a new colour attribute to this node type.
Definition: NodeHelper.h:711
static MStatus outputFloatPointValue(MDataBlock &dataBlock, const MObject &attribute, const MFloatPoint &value)
Set the output value of the specified attribute in the datablock.
static int8_t inputInt8Value(MDataBlock &dataBlock, const MObject &attribute)
get an input 8 bit integer value from the dataBlock from the specified attribute
The attribute should be stored in a maya file.
Definition: NodeHelper.h:494
The attribute can be connected to another attr.
Definition: NodeHelper.h:497
static MPxDataType * createData(const MTypeId &dataTypeId, MObject &data)
helper method to create new data objects of the specified data type
Definition: NodeHelper.h:480
static MPxData * createData(const MTypeId &dataTypeId, MObject &data)
helper method to create new data objects of the specified data type
a load file dialog
Definition: NodeHelper.h:512
static MStatus outputMatrixValue(MDataBlock &dataBlock, const MObject &attribute, const MMatrix &value)
Set the output value of the specified attribute in the datablock.
static double inputDoubleValue(MDataBlock &dataBlock, const MObject &attribute)
get an input double value from the dataBlock from the specified attribute
static MStatus outputBoolValue(MDataBlock &dataBlock, const MObject &attribute, bool value)
Set the output value of the specified attribute in the datablock.
static MPxDataType * inputDataValue(MDataBlock &dataBlock, const MObject &attribute)
get an input data value from the dataBlock from the specified attribute
Definition: NodeHelper.h:338
The attribute is an array.
Definition: NodeHelper.h:498
static MTime inputTimeValue(MDataBlock &dataBlock, const MObject &attribute)
get an input time value from the dataBlock from the specified attribute
static MStatus outputFloatVectorValue(MDataBlock &dataBlock, const MObject &attribute, const MFloatVector &value)
Set the output value of the specified attribute in the datablock.
This is a little helper object designed to reduce the amount of boilerplate GUI code you need to jump...
Definition: NodeHelper.h:175
static void setMinMax(MObject obj, datatype minimum, datatype maximum)
set the min/max values on a numeric attribute
Definition: NodeHelper.h:855
static MStatus outputInt64Value(MDataBlock &dataBlock, const MObject &attribute, int64_t value)
Set the output value of the specified attribute in the datablock.
static MString inputStringValue(MDataBlock &dataBlock, const MObject &attribute)
get an input string value from the dataBlock from the specified attribute
The attribute should be readable (output)
Definition: NodeHelper.h:492
The attribute is a colour (UI will display a colour picker in the GUI)
Definition: NodeHelper.h:499