AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AL::maya::NodeHelper Class Reference

This is a little helper object designed to reduce the amount of boilerplate GUI code you need to jump through to add your own nodes that match a USD schema type. It has been designed to attempt to match the attribute types of USD as closely as possible, so adds support for 2x2 / 3x3 matrix types, half float support, etc. More...

#include <NodeHelper.h>

Inheritance diagram for AL::maya::NodeHelper:
AL::usdmaya::nodes::Layer AL::usdmaya::nodes::ProxyShape AL::usdmaya::nodes::Transform

Public Member Functions

 NodeHelper ()
 ctor
 
 ~NodeHelper ()
 dtor
 

Static Public Member Functions

Access Input Values from an MDataBlock
static bool inputBoolValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input boolean value from the dataBlock from the specified attribute More...
 
static int8_t inputInt8Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 8 bit integer value from the dataBlock from the specified attribute More...
 
static int16_t inputInt16Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 16 bit integer value from the dataBlock from the specified attribute More...
 
static int32_t inputInt32Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 32 bit integer value from the dataBlock from the specified attribute More...
 
static int64_t inputInt64Value (MDataBlock &dataBlock, const MObject &attribute)
 get an input 64 bit integer value from the dataBlock from the specified attribute More...
 
static float inputFloatValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input float value from the dataBlock from the specified attribute More...
 
static double inputDoubleValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input double value from the dataBlock from the specified attribute More...
 
static MMatrix inputMatrixValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input matrix value from the dataBlock from the specified attribute More...
 
static MPoint inputPointValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input point value from the dataBlock from the specified attribute More...
 
static MFloatPoint inputFloatPointValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input point value from the dataBlock from the specified attribute More...
 
static MVector inputVectorValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input vector value from the dataBlock from the specified attribute More...
 
static MTime inputTimeValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input time value from the dataBlock from the specified attribute More...
 
static MFloatVector inputFloatVectorValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input vector value from the dataBlock from the specified attribute More...
 
static MColor inputColourValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input colour value from the dataBlock from the specified attribute More...
 
static MString inputStringValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input string value from the dataBlock from the specified attribute More...
 
static MPxData * inputDataValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input data value from the dataBlock from the specified attribute More...
 
template<typename MPxDataType >
static MPxDataType * inputDataValue (MDataBlock &dataBlock, const MObject &attribute)
 get an input data value from the dataBlock from the specified attribute More...
 
Set Output Values from an MDataBlock
static MStatus outputBoolValue (MDataBlock &dataBlock, const MObject &attribute, bool value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt8Value (MDataBlock &dataBlock, const MObject &attribute, int8_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt16Value (MDataBlock &dataBlock, const MObject &attribute, int16_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt32Value (MDataBlock &dataBlock, const MObject &attribute, int32_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputInt64Value (MDataBlock &dataBlock, const MObject &attribute, int64_t value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatValue (MDataBlock &dataBlock, const MObject &attribute, float value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputDoubleValue (MDataBlock &dataBlock, const MObject &attribute, double value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputMatrixValue (MDataBlock &dataBlock, const MObject &attribute, const MMatrix &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputPointValue (MDataBlock &dataBlock, const MObject &attribute, const MPoint &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatPointValue (MDataBlock &dataBlock, const MObject &attribute, const MFloatPoint &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputVectorValue (MDataBlock &dataBlock, const MObject &attribute, const MVector &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputEulerValue (MDataBlock &dataBlock, const MObject &attribute, const MEulerRotation &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputFloatVectorValue (MDataBlock &dataBlock, const MObject &attribute, const MFloatVector &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputColourValue (MDataBlock &dataBlock, const MObject &attribute, const MColor &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputStringValue (MDataBlock &dataBlock, const MObject &attribute, const MString &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputTimeValue (MDataBlock &dataBlock, const MObject &attribute, const MTime &value)
 Set the output value of the specified attribute in the datablock. More...
 
static MStatus outputDataValue (MDataBlock &dataBlock, const MObject &attribute, MPxData *value)
 Set the output value of the specified attribute in the datablock. More...
 
static MPxData * createData (const MTypeId &dataTypeId, MObject &data)
 helper method to create new data objects of the specified data type More...
 
template<typename MPxDataType >
static MPxDataType * createData (const MTypeId &dataTypeId, MObject &data)
 helper method to create new data objects of the specified data type More...
 

Specify the attributes of a node, and AE GUI generation

enum  AttributeFlags {
  kCached = 1 << 0, kReadable = 1 << 1, kWritable = 1 << 2, kStorable = 1 << 3,
  kAffectsAppearance = 1 << 4, kKeyable = 1 << 5, kConnectable = 1 << 6, kArray = 1 << 7,
  kColour = 1 << 8, kHidden = 1 << 9, kInternal = 1 << 10, kAffectsWorldSpace = 1 << 11,
  kUsesArrayDataBuilder = 1 << 12, kDontAddToNode = 1 << 30, kDynamic = 1 << 31
}
 A set of bit flags you can apply to an attribute. More...
 
enum  FileMode {
  kSave = 0, kLoad = 1, kDirectoryWithFiles = 2, kDirectory = 3,
  kMultiLoad = 4
}
 Specify the type of file/dir path when adding file path attributes. See addFilePathAttr. More...
 
static void setNodeType (const MString &typeName)
 Sets the node type name you are adding attributes. Please call this before adding any frames! More...
 
static void addFrame (const char *frameTitle)
 Add a new frame control into the AE template. More...
 
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 More...
 
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 More...
 
static MObject addStringAttr (const char *longName, const char *shortName, uint32_t flags, bool forceShow=false)
 add a new string attribute to this node type. More...
 
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. More...
 
static MObject addInt8Attr (const char *longName, const char *shortName, int8_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt16Attr (const char *longName, const char *shortName, int16_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt32Attr (const char *longName, const char *shortName, int32_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addInt64Attr (const char *longName, const char *shortName, int64_t defaultValue, uint32_t flags)
 add a new integer attribute to this node type. More...
 
static MObject addFloatAttr (const char *longName, const char *shortName, float defaultValue, uint32_t flags)
 add a new floating point attribute to this node type. More...
 
static MObject addDoubleAttr (const char *longName, const char *shortName, double defaultValue, uint32_t flags)
 add a new double attribute to this node type. More...
 
static MObject addTimeAttr (const char *longName, const char *shortName, const MTime &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addDistanceAttr (const char *longName, const char *shortName, const MDistance &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addAngleAttr (const char *longName, const char *shortName, const MAngle &defaultValue, uint32_t flags)
 add a new time attribute to this node type. More...
 
static MObject addBoolAttr (const char *longName, const char *shortName, bool defaultValue, uint32_t flags)
 add a new boolean attribute to this node type. More...
 
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. More...
 
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. More...
 
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. More...
 
static MObject addPointAttr (const char *longName, const char *shortName, const MPoint &defaultValue, uint32_t flags)
 add a new point attribute to this node type. More...
 
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. More...
 
static MObject addVectorAttr (const char *longName, const char *shortName, const MVector &defaultValue, uint32_t flags)
 add a new vector attribute to this node type. More...
 
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. More...
 
static MObject addColourAttr (const char *longName, const char *shortName, const MColor &defaultValue, uint32_t flags)
 add a new colour attribute to this node type. More...
 
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. More...
 
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. More...
 
static MObject addMatrixAttr (const char *longName, const char *shortName, const MMatrix &defaultValue, uint32_t flags)
 add a new matrix attribute to this node type. More...
 
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. More...
 
static MObject addDataAttr (const char *longName, const char *shortName, const MTypeId &type, uint32_t flags, MFnAttribute::DisconnectBehavior behaviour=MFnAttribute::kNothing)
 add a new data attribute to this node type. More...
 
static MObject addMessageAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new message attribute to this node type. More...
 
static MObject addVec2hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec2dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 2D vector attribute to this node type. More...
 
static MObject addVec3hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec3dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 3D vector attribute to this node type. More...
 
static MObject addVec4hAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4fAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4iAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
static MObject addVec4dAttr (const char *longName, const char *shortName, uint32_t flags)
 add a new 4D vector attribute to this node type. More...
 
template<typename datatype >
static void setMinMax (MObject obj, datatype minimum, datatype maximum)
 set the min/max values on a numeric attribute More...
 
template<typename datatype >
static void setMinMax (MObject obj, datatype minimum, datatype maximum, datatype softmin, datatype softmax)
 set the min/max/softmax values on a numeric attribute More...
 
static void addBaseTemplate (const std::string &baseTemplate)
 used to add additional references to AETemplate calls for standard types, e.g. "AEsurfaceShapeTemplate" these will be inserted into the correct location More...
 
static void generateAETemplate ()
 This method will construct up the MEL script code for the attribute editor template for your node. Once constructed, the code will be executed silently in the background. If you wish to see the code being executed, enable 'echo all commands' in the MEL script editor prior to loading your plug-in.
 

Add Dynamic Attributes to Node

static MStatus addStringAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, bool forceShow=false, MObject *attribute=0)
 add a new string attribute to this node type. More...
 
static MStatus addFilePathAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, FileMode fileMode, const char *fileFilter="", MObject *attribute=0)
 add a new file path attribute to this node type. More...
 
static MStatus addInt8Attr (const MObject &node, const char *longName, const char *shortName, int8_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt16Attr (const MObject &node, const char *longName, const char *shortName, int16_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt32Attr (const MObject &node, const char *longName, const char *shortName, int32_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addInt64Attr (const MObject &node, const char *longName, const char *shortName, int64_t defaultValue, uint32_t flags, MObject *attribute=0)
 add a new integer attribute to this node type. More...
 
static MStatus addFloatAttr (const MObject &node, const char *longName, const char *shortName, float defaultValue, uint32_t flags, MObject *attribute=0)
 add a new floating point attribute to this node type. More...
 
static MStatus addDoubleAttr (const MObject &node, const char *longName, const char *shortName, double defaultValue, uint32_t flags, MObject *attribute=0)
 add a new double attribute to this node type. More...
 
static MStatus addTimeAttr (const MObject &node, const char *longName, const char *shortName, const MTime &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addDistanceAttr (const MObject &node, const char *longName, const char *shortName, const MDistance &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addAngleAttr (const MObject &node, const char *longName, const char *shortName, const MAngle &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new time attribute to this node type. More...
 
static MStatus addBoolAttr (const MObject &node, const char *longName, const char *shortName, bool defaultValue, uint32_t flags, MObject *attribute=0)
 add a new boolean attribute to this node type. More...
 
static MStatus addFloat3Attr (const MObject &node, const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags, MObject *attribute=0)
 add a new float3 attribute to this node type. More...
 
static MStatus addAngle3Attr (const MObject &node, const char *longName, const char *shortName, float defaultX, float defaultY, float defaultZ, uint32_t flags, MObject *attribute=0)
 add a new float3 attribute to this node type. More...
 
static MStatus addPointAttr (const MObject &node, const char *longName, const char *shortName, const MPoint &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new point attribute to this node type. More...
 
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. More...
 
static MStatus addVectorAttr (const MObject &node, const char *longName, const char *shortName, const MVector &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new vector attribute to this node type. More...
 
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. More...
 
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. More...
 
static MStatus addMatrixAttr (const MObject &node, const char *longName, const char *shortName, const MMatrix &defaultValue, uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
static MStatus addMatrix2x2Attr (const MObject &node, const char *longName, const char *shortName, const float defaultValue[2][2], uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
static MStatus addMatrix3x3Attr (const MObject &node, const char *longName, const char *shortName, const float defaultValue[3][3], uint32_t flags, MObject *attribute=0)
 add a new matrix attribute to this node type. More...
 
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)
 add a new data attribute to this node type. More...
 
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)
 add a new data attribute to this node type. More...
 
static MStatus addMessageAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new message attribute to this node type. More...
 
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. More...
 
static MStatus addVec2fAttr (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. More...
 
static MStatus addVec2iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D integer vector attribute to this node type. More...
 
static MStatus addVec2dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 2D double precision vector attribute to this node type. More...
 
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. More...
 
static MStatus addVec3fAttr (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. More...
 
static MStatus addVec3iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D integer vector attribute to this node type. More...
 
static MStatus addVec3dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 3D double precision vector attribute to this node type. More...
 
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. More...
 
static MStatus addVec4fAttr (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. More...
 
static MStatus addVec4iAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D integer vector attribute to this node type. More...
 
static MStatus addVec4dAttr (const MObject &node, const char *longName, const char *shortName, uint32_t flags, MObject *attribute=0)
 add a new 4D double precision vector attribute to this node type. More...
 

Detailed Description

This is a little helper object designed to reduce the amount of boilerplate GUI code you need to jump through to add your own nodes that match a USD schema type. It has been designed to attempt to match the attribute types of USD as closely as possible, so adds support for 2x2 / 3x3 matrix types, half float support, etc.

In order to use this class, you should inherit from which ever MPxNode type you need (e.g. MPxLocator, MPxSurfaceShape, etc), as well as the NodeHelper class. So your header file should look something like this:

#pragma once
#include "AL/maya/NodeHelper.h"
#include <maya/MPxNode.h>
// extremely simple node that adds two numbers
class Add2Floats
: public MPxNode,
{
public:
MStatus compute(const MPlug& plug, MDataBlock& dataBlock) override;
};

And then in the cpp file...

#include "Add2Floats.h"
// NOTE: I'm prefixing all calls to inherited functions from NodeHelper with the full scope. There is no reason
// to do this in C++. I'm only doing it in this example code to get the documentation to contain links to the actual
// functions involved!
// some boiler plate to define the typeId as 0x1234, and the node name as "AL_examples_Add2Floats"
AL_MAYA_DEFINE_NODE(Add2Floats, 0x1234, AL_examples);
// make sure you add the static MObjects for your node attributes
MObject Add2Floats::m_input0 = MObject::kNullObj;
MObject Add2Floats::m_input1 = MObject::kNullObj;
MObject Add2Floats::m_output = MObject::kNullObj;
// initialise the attributes
MStatus Add2Floats::initialise()
{
// the node helper will throw an exception if any underlying MFnAttribute calls fails.
try
{
// first specify the typename of the node (this is required in order to sure the AE Template
// generated will correctly match this node type)
// You *MUST* add at least one AETemplate frame to insert controls into. Once you have added
// a frame, all subsequent attributes will be displayed under the frame group. You can add
// as many frames as you wish.
AL::maya::NodeHelper::addFrame("Add 2 Float GUI");
// add the two input attributes
// add the output
m_output = AL::maya::NodeHelper::addFloatAttr("output", "out", 0.0f, kReadable | kConnectable);
// set up the attribute dependencies as per usual
attributeAffects(m_input0, m_output);
attributeAffects(m_input1, m_output);
}
catch(const MStatus& status)
{
return status;
}
// finally, generate and execute the AE Template for this node.
// all done!
return MS::kSuccess;
}
// the compute method
MStatus Add2Floats::compute(const MPlug& plug, MDataBlock& dataBlock)
{
if(plug == output())
{
// grab input data
const float in0 = AL::maya::NodeHelper::inputFloatValue(dataBlock, input0());
const float in1 = AL::maya::NodeHelper::inputFloatValue(dataBlock, input1());
// sum both values, and set the output
return AL::maya::NodeHelper::outputFloatValue(dataBlock, output(), in0 + in1);
}
return MPxNode::compute(plug, dataBlock);
}

and finally, within your main plugin.cpp, you should be able to simply do:

#include <maya/MFnPlugin.h>
#include "Add2Floats.h"
DSO_EXPORT MStatus initializePlugin(MObject obj)
{
MFnPlugin plugin(obj);
AL_REGISTER_DEPEND_NODE(plugin, Add2Floats);
return MS::kSuccess;
}
DSO_EXPORT MStatus uninitializePlugin(MObject obj)
{
MFnPlugin plugin(obj);
AL_UNREGISTER_NODE(plugin, Add2Floats);
return MS::kSuccess;
}
Note
For a complete example of how it should be used, please see the AL::maya::NodeHelperUnitTest files.

Member Enumeration Documentation

A set of bit flags you can apply to an attribute.

Enumerator
kCached 

The attribute should be cached.

kReadable 

The attribute should be readable (output)

kWritable 

The attribute should be writable (input)

kStorable 

The attribute should be stored in a maya file.

kAffectsAppearance 

the attribute affects the appearance of a shape

kKeyable 

The attribute can be animated.

kConnectable 

The attribute can be connected to another attr.

kArray 

The attribute is an array.

kColour 

The attribute is a colour (UI will display a colour picker in the GUI)

kHidden 

The attribute is hidden.

kInternal 

The attribute value will be stored as a member variable, and getInternalValueInContext / setInternalValueInContext will be overridden to get/set the value.

kAffectsWorldSpace 

The attribute affects the world space matrix of a custom transform node.

kUsesArrayDataBuilder 

The array can be resized via an array data builder.

kDontAddToNode 

prevent the attribute from being added to the current node type

kDynamic 

The attribute is a dynamic attribute added at runtime (and not during a plug-in node initialization)

Specify the type of file/dir path when adding file path attributes. See addFilePathAttr.

Enumerator
kSave 

a save file dialog

kLoad 

a load file dialog

kDirectoryWithFiles 

a directory dialog, but displays files.

kDirectory 

a directory dialog

kMultiLoad 

multiple input files

Member Function Documentation

static MObject AL::maya::NodeHelper::addAngle3Attr ( const char *  longName,
const char *  shortName,
float  defaultX,
float  defaultY,
float  defaultZ,
uint32_t  flags 
)
static

add a new float3 attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultXthe default value for the attribute
defaultYthe default value for the attribute
defaultZthe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addAngle3Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
float  defaultX,
float  defaultY,
float  defaultZ,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new float3 attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultXthe default value for the attribute
defaultYthe default value for the attribute
defaultZthe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
static MObject AL::maya::NodeHelper::addAngleAttr ( const char *  longName,
const char *  shortName,
const MAngle &  defaultValue,
uint32_t  flags 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addAngleAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MAngle &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static void AL::maya::NodeHelper::addBaseTemplate ( const std::string &  baseTemplate)
inlinestatic

used to add additional references to AETemplate calls for standard types, e.g. "AEsurfaceShapeTemplate" these will be inserted into the correct location

Parameters
baseTemplatethe additional AE template UI
static MObject AL::maya::NodeHelper::addBoolAttr ( const char *  longName,
const char *  shortName,
bool  defaultValue,
uint32_t  flags 
)
static

add a new boolean attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addBoolAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
bool  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new boolean attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addColourAttr ( const char *  longName,
const char *  shortName,
const MColor &  defaultValue,
uint32_t  flags 
)
inlinestatic

add a new colour attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addColourAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MColor &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new colour attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addCompoundAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags,
std::initializer_list< MObject >  list 
)
static

add a new compound attribute to this node type

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
listthe attributes you wish to add as children to this node.
static MObject AL::maya::NodeHelper::addDataAttr ( const char *  longName,
const char *  shortName,
MFnData::Type  type,
uint32_t  flags,
MFnAttribute::DisconnectBehavior  behaviour = MFnAttribute::kNothing 
)
static

add a new data attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
typethe data type for the attribute
behaviouroptionally control what happens when the attribute is disconnected
Returns
the MObject for the attribute
static MObject AL::maya::NodeHelper::addDataAttr ( const char *  longName,
const char *  shortName,
const MTypeId &  type,
uint32_t  flags,
MFnAttribute::DisconnectBehavior  behaviour = MFnAttribute::kNothing 
)
static

add a new data attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
typethe data type for the attribute
behaviouroptionally control what happens when the attribute is disconnected
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addDataAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
MFnData::Type  type,
uint32_t  flags,
MFnAttribute::DisconnectBehavior  behaviour = MFnAttribute::kNothing,
MObject *  attribute = 0 
)
static

add a new data attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
typethe data type for the attribute
behaviouroptionally control what happens when the attribute is disconnected
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MStatus AL::maya::NodeHelper::addDataAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MTypeId &  type,
uint32_t  flags,
MFnAttribute::DisconnectBehavior  behaviour = MFnAttribute::kNothing,
MObject *  attribute = 0 
)
static

add a new data attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
typethe data type for the attribute
behaviouroptionally control what happens when the attribute is disconnected
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addDistance3Attr ( const char *  longName,
const char *  shortName,
float  defaultX,
float  defaultY,
float  defaultZ,
uint32_t  flags 
)
static

add a new float3 attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultXthe default value for the attribute
defaultYthe default value for the attribute
defaultZthe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
static MObject AL::maya::NodeHelper::addDistanceAttr ( const char *  longName,
const char *  shortName,
const MDistance &  defaultValue,
uint32_t  flags 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addDistanceAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MDistance &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addDoubleAttr ( const char *  longName,
const char *  shortName,
double  defaultValue,
uint32_t  flags 
)
static

add a new double attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addDoubleAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
double  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new double attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addEnumAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags,
const char *const *  strings,
const int16_t *  values 
)
static

add a new enum attribute to this node type

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
stringsan array of text strings for the enum values. This last item in this array must be NULL
valuesan array of numeric enum values.
Returns
the MObject for the attribute
static MObject AL::maya::NodeHelper::addFilePathAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags,
FileMode  fileMode,
const char *  fileFilter = "" 
)
static

add a new file path attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
fileModean enum that determines whether the GUI should display a file open dialog, file save, or directory dialog.
fileFiltera file filter of the form: "USD Files (*.usd*) (*.usd*);;Alembic Files (*.abc) (*.abc);;All files (*.*) (*.*)"
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addFilePathAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
FileMode  fileMode,
const char *  fileFilter = "",
MObject *  attribute = 0 
)
static

add a new file path attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
fileFiltera file filter of the form: "USD Files (*.usd*) (*.usd*);;Alembic Files (*.abc) (*.abc);;All files (*.*) (*.*)"
fileModean enum that determines whether the GUI should display a file open dialog, file save, or directory dialog.
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addFloat3Attr ( const char *  longName,
const char *  shortName,
float  defaultX,
float  defaultY,
float  defaultZ,
uint32_t  flags 
)
static

add a new float3 attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultXthe default value for the attribute
defaultYthe default value for the attribute
defaultZthe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addFloat3Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
float  defaultX,
float  defaultY,
float  defaultZ,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new float3 attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultXthe default value for the attribute
defaultYthe default value for the attribute
defaultZthe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
static MObject AL::maya::NodeHelper::addFloatAttr ( const char *  longName,
const char *  shortName,
float  defaultValue,
uint32_t  flags 
)
static

add a new floating point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addFloatAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
float  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new floating point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addFloatPointAttr ( const char *  longName,
const char *  shortName,
const MFloatPoint &  defaultValue,
uint32_t  flags 
)
inlinestatic

add a new float point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addFloatPointAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MFloatPoint &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new float point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addFloatVectorAttr ( const char *  longName,
const char *  shortName,
const MFloatVector &  defaultValue,
uint32_t  flags 
)
inlinestatic

add a new float vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addFloatVectorAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MFloatVector &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new float vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static void AL::maya::NodeHelper::addFrame ( const char *  frameTitle)
static

Add a new frame control into the AE template.

Parameters
frameTitlethe text to appear in the ui frame
Note
You MUST call this method at least once before adding any attributes
static MObject AL::maya::NodeHelper::addInt16Attr ( const char *  longName,
const char *  shortName,
int16_t  defaultValue,
uint32_t  flags 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addInt16Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
int16_t  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addInt32Attr ( const char *  longName,
const char *  shortName,
int32_t  defaultValue,
uint32_t  flags 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addInt32Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
int32_t  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addInt64Attr ( const char *  longName,
const char *  shortName,
int64_t  defaultValue,
uint32_t  flags 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addInt64Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
int64_t  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addInt8Attr ( const char *  longName,
const char *  shortName,
int8_t  defaultValue,
uint32_t  flags 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addInt8Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
int8_t  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new integer attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addMatrix2x2Attr ( const char *  longName,
const char *  shortName,
const float  defaultValue[2][2],
uint32_t  flags 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addMatrix2x2Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const float  defaultValue[2][2],
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addMatrix3x3Attr ( const char *  longName,
const char *  shortName,
const float  defaultValue[3][3],
uint32_t  flags 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addMatrix3x3Attr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const float  defaultValue[3][3],
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addMatrixAttr ( const char *  longName,
const char *  shortName,
const MMatrix &  defaultValue,
uint32_t  flags 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addMatrixAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MMatrix &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new matrix attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addMessageAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new message attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addMessageAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new message attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addPointAttr ( const char *  longName,
const char *  shortName,
const MPoint &  defaultValue,
uint32_t  flags 
)
static

add a new point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addPointAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MPoint &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new point attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addStringAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags,
bool  forceShow = false 
)
static

add a new string attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
forceShowforce attribute to be shown. Used in case attribute is not writable but needs to be shown i.e. read-only.
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addStringAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
bool  forceShow = false,
MObject *  attribute = 0 
)
static

add a new string attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
forceShowforce attribute to be shown. Used in case attribute is not writable but needs to be shown i.e. read-only.
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addTimeAttr ( const char *  longName,
const char *  shortName,
const MTime &  defaultValue,
uint32_t  flags 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addTimeAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MTime &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new time attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec2dAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 2D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec2dAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 2D double precision vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec2fAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 2D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec2fAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 2D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec2hAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
inlinestatic

add a new 2D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec2hAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new 2D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec2iAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 2D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec2iAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 2D integer vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec3dAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 3D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec3dAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 3D double precision vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec3fAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 3D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec3fAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 3D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec3hAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
inlinestatic

add a new 3D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec3hAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new 3D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec3iAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 3D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec3iAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 3D integer vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec4dAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 4D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec4dAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 4D double precision vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec4fAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 4D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec4fAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 4D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec4hAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
inlinestatic

add a new 4D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec4hAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
inlinestatic

add a new 4D floating point vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVec4iAttr ( const char *  longName,
const char *  shortName,
uint32_t  flags 
)
static

add a new 4D vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVec4iAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new 4D integer vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MObject AL::maya::NodeHelper::addVectorAttr ( const char *  longName,
const char *  shortName,
const MVector &  defaultValue,
uint32_t  flags 
)
static

add a new vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
Returns
the MObject for the attribute
static MStatus AL::maya::NodeHelper::addVectorAttr ( const MObject &  node,
const char *  longName,
const char *  shortName,
const MVector &  defaultValue,
uint32_t  flags,
MObject *  attribute = 0 
)
static

add a new vector attribute to this node type.

Parameters
longNamelong name for the attribute
shortNameshort name for the attribute
defaultValuethe default value for the attribute
flagsa bitfield containing a mask of the AttributeFlags enumeration. Describes if the attribute is an input/output/etc
nodethe node to add the attribute to
attributean optional pointer to an MObject in which the attribute handle will be returned
Returns
MS::kSuccess when succeeded, otherwise the error code
static MPxData* AL::maya::NodeHelper::createData ( const MTypeId &  dataTypeId,
MObject &  data 
)
static

helper method to create new data objects of the specified data type

Parameters
dataTypeIdthe MTypeId of the plugin data object to create
datathe returned handle to the created data object, usually passed to MDataHandle::set, or MPlug::setValue.
Returns
a pointer to the data object created
template<typename MPxDataType >
static MPxDataType* AL::maya::NodeHelper::createData ( const MTypeId &  dataTypeId,
MObject &  data 
)
inlinestatic

helper method to create new data objects of the specified data type

Parameters
dataTypeIdthe MTypeId of the plugin data object to create
datathe returned handle to the created data object, usually passed to MDataHandle::set, or MPlug::setValue.
Returns
a pointer to the data object created
static bool AL::maya::NodeHelper::inputBoolValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input boolean value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MColor AL::maya::NodeHelper::inputColourValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input colour value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MPxData* AL::maya::NodeHelper::inputDataValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input data value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
template<typename MPxDataType >
static MPxDataType* AL::maya::NodeHelper::inputDataValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
inlinestatic

get an input data value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static double AL::maya::NodeHelper::inputDoubleValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input double value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MFloatPoint AL::maya::NodeHelper::inputFloatPointValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input point value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static float AL::maya::NodeHelper::inputFloatValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input float value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MFloatVector AL::maya::NodeHelper::inputFloatVectorValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input vector value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static int16_t AL::maya::NodeHelper::inputInt16Value ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input 16 bit integer value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static int32_t AL::maya::NodeHelper::inputInt32Value ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input 32 bit integer value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static int64_t AL::maya::NodeHelper::inputInt64Value ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input 64 bit integer value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static int8_t AL::maya::NodeHelper::inputInt8Value ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input 8 bit integer value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MMatrix AL::maya::NodeHelper::inputMatrixValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input matrix value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MPoint AL::maya::NodeHelper::inputPointValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input point value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MString AL::maya::NodeHelper::inputStringValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input string value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MTime AL::maya::NodeHelper::inputTimeValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input time value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MVector AL::maya::NodeHelper::inputVectorValue ( MDataBlock &  dataBlock,
const MObject &  attribute 
)
static

get an input vector value from the dataBlock from the specified attribute

Parameters
dataBlockthe data block to get the value from
attributethe handle to the attribute to query
Returns
the value
Note
If the value could not be queried, and error will be logged to std::cerr
static MStatus AL::maya::NodeHelper::outputBoolValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
bool  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputColourValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MColor &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputDataValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
MPxData *  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputDoubleValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
double  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputEulerValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MEulerRotation &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputFloatPointValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MFloatPoint &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputFloatValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
float  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputFloatVectorValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MFloatVector &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputInt16Value ( MDataBlock &  dataBlock,
const MObject &  attribute,
int16_t  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputInt32Value ( MDataBlock &  dataBlock,
const MObject &  attribute,
int32_t  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputInt64Value ( MDataBlock &  dataBlock,
const MObject &  attribute,
int64_t  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputInt8Value ( MDataBlock &  dataBlock,
const MObject &  attribute,
int8_t  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputMatrixValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MMatrix &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputPointValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MPoint &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputStringValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MString &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputTimeValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MTime &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
static MStatus AL::maya::NodeHelper::outputVectorValue ( MDataBlock &  dataBlock,
const MObject &  attribute,
const MVector &  value 
)
static

Set the output value of the specified attribute in the datablock.

Parameters
dataBlockthe data block to set the value in
attributethe handle to the attribute to set
valuethe attribute value to set
Returns
MS::kSuccess if all went well
template<typename datatype >
static void AL::maya::NodeHelper::setMinMax ( MObject  obj,
datatype  minimum,
datatype  maximum 
)
inlinestatic

set the min/max values on a numeric attribute

Parameters
objthe attribute handle
minimumthe min value for the attribute
maximumthe max value for the attribute
template<typename datatype >
static void AL::maya::NodeHelper::setMinMax ( MObject  obj,
datatype  minimum,
datatype  maximum,
datatype  softmin,
datatype  softmax 
)
inlinestatic

set the min/max/softmax values on a numeric attribute

Parameters
objthe attribute handle
minimumthe min value for the attribute
maximumthe max value for the attribute
softminthe soft min value for the attribute
softmaxthe soft max value for the attribute
static void AL::maya::NodeHelper::setNodeType ( const MString &  typeName)
static

Sets the node type name you are adding attributes. Please call this before adding any frames!

Parameters
typeNamethe type name of the node

The documentation for this class was generated from the following file: