Typed attribute function set.
MFnTypedAttribute is the function set for typed dependency node attributes. A typed attribute accepts exactly one type of data. The type that it accepts is set when the attribute is created.
Once a typed attribute had been created, the data for it can be accessed using an MDataHandle while in your node's compute method.
animCubeNode.cpp, apiMeshCreator.cpp, apiMeshShape.cpp, arcLenNode.cpp, blindComplexDataCmd.cpp, blindDataMesh.cpp, blindDoubleDataCmd.cpp, cgfxAttrDef.cpp, cgfxShaderNode.cpp, closestPointOnCurveNode.cpp, cvColorNode.cpp, fullLoftNode.cpp, geometrySurfaceConstraint.cpp, GLSLShaderNode.cpp, hlslShader.cpp, hwAnisotropicShader_NV20.cpp, hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20.cpp, hwReflectBumpShader_NV20.cpp, hwRefractReflectShader_NV20.cpp, hwToonShader_NV20.cpp, hwUnlitShader.cpp, latticeNoiseNode.cpp, meshOpNode.cpp, multiCurveNode.cpp, particleAttrNode.cpp, pointOnMeshInfoNode.cpp, pointOnSubdNode.cpp, shellNode.cpp, simpleLoftNode.cpp, slopeShaderNode.cpp, splitUVNode.cpp, stringFormatNode.cpp, testNobjectNode.cpp, and testNucleusNode.cpp.
#include <MFnTypedAttribute.h>
Public Member Functions |
|
virtual MFn::Type | type () const |
Function set type. |
|
virtual | ~MFnTypedAttribute () |
Destructor. |
|
MFnTypedAttribute () | |
Default constructor. |
|
MFnTypedAttribute (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. |
|
MObject | create (const MString &fullName, const MString &briefName, const MTypeId &id, MObject defaultData=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Create a new typed attribute with the given
type. |
|
MObject | create (const MString &fullName, const MString &briefName, MFnData::Type type, MObject defaultData=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Create a new typed attribute with the given
type. |
|
MFnData::Type | attrType (MStatus *ReturnStatus=NULL) const |
Return the type of this attribute. |
|
MStatus | getDefault (MObject &defaultCustomData) |
Get the default data for this attribute.
|
|
MStatus | setDefault (const MObject &defaultCustomData) |
Set the default data for this attribute.
|
|
MObject | create (const MString &fullName, const MString &briefName, MFnData::Type type, MStatus *ReturnStatus) |
This method is obsolete. This
method is not available in Python. |
|
MFnTypedAttribute (const MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. |
|
Protected Member Functions |
|
virtual const char * | className () const |
Class name. |
MFnTypedAttribute | ( | MObject & | object, |
MStatus * | ReturnStatus =
NULL |
||
) |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFnTypedAttribute | ( | const MObject & | object, |
MStatus * | ReturnStatus =
NULL |
||
) |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFn::Type type | ( | ) | const [virtual] |
const char * className | ( | ) | const [protected, virtual] |
MObject create | ( | const MString & | full, |
const MString & | brief, | ||
const MTypeId & | id, | ||
MObject | defaultData = MObject::kNullObj , |
||
MStatus * | ReturnStatus =
NULL |
||
) |
Create a new typed attribute with the given type.
[in] | full | Full name for the new attribute. |
[in] | brief | Short name for the attribute. |
[in] | id | Type id of the attribute's data. |
[in] | defaultData | Default data for the attribute. |
[out] | ReturnStatus | Return status. |
MObject create | ( | const MString & | full, |
const MString & | brief, | ||
MFnData::Type | type, | ||
MObject | defaultData = MObject::kNullObj , |
||
MStatus * | ReturnStatus =
NULL |
||
) |
Create a new typed attribute with the given type.
The create method needs to be called on a per node basis. That means if you want to create and add the same attribute to multiple nodes, you need to call the create method for each node to get a unique MObject back. If you call create just once and add the attribute to multiple nodes, Maya will encounter a fatal error.
[in] | full | Full name for the new attribute. |
[in] | brief | Short name for the attribute. |
[in] | type | Type of the attribute's data. |
[in] | defaultData | Default data for the attribute. |
[out] | ReturnStatus | Return status. |
MFnData::Type attrType | ( | MStatus * | ReturnStatus =
NULL |
) | const |
Return the type of this attribute.
[out] | ReturnStatus |
Get the default data for this attribute.
The data can then be operated on using the appropriate MFn*Data functionset.
[out] | defaultData | receives a copy of the attribute's default data. |
Set the default data for this attribute.
The data can be created using the appropriate MFn*Data function set.
[in] | defaultData | default data for the attribute |
MObject create | ( | const MString & | full, |
const MString & | brief, | ||
MFnData::Type | type, | ||
MStatus * | ReturnStatus | ||
) |
This method is obsolete. This method is not available in Python.
Create a new typed attribute with the given type.
[in] | full | Full name for the new attribute. |
[in] | brief | Short name for the attribute. |
[in] | type | Type of the attribute's data. |
[out] | ReturnStatus | Return status. |