MFnTypedAttribute Class Reference
[OpenMaya - API module for common classesFunctionSet classes]

#include <MFnTypedAttribute.h>

Inheritance diagram for MFnTypedAttribute:

Inheritance graph
[legend]
Collaboration diagram for MFnTypedAttribute:

Collaboration graph
[legend]

List of all members.


Detailed Description

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.

Examples:

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.


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)
MObject create (const MString &fullName, const MString &briefName, MFnData::Type type, MObject defaultData=MObject::kNullObj, MStatus *ReturnStatus=NULL)
MFnData::Type attrType (MStatus *ReturnStatus=NULL) const
MStatus getDefault (MObject &defaultCustomData)
MStatus setDefault (const MObject &defaultCustomData)
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.

Constructor & Destructor Documentation

MFnTypedAttribute::MFnTypedAttribute ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in] object The MObject to attach the function set to
[out] ReturnStatus the return status
Status Codes:

MFnTypedAttribute::MFnTypedAttribute ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in] object The MObject to attach the function set to
[out] ReturnStatus the return status
Status Codes:


Member Function Documentation

MFn::Type MFnTypedAttribute::type (  )  const [virtual]

Function set type.

Return the class type : MFn::kTypedAttribute

Reimplemented from MFnAttribute.

const char * MFnTypedAttribute::className (  )  const [protected, virtual]

Class name.

Return the class name : "MFnTypedAttribute"

Reimplemented from MFnAttribute.

MObject MFnTypedAttribute::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.

Parameters:
[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.
Returns:
Pointer to the new attribute object.
Status Codes:
Examples:

MObject MFnTypedAttribute::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.

Parameters:
[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.
Returns:
Pointer to the new attribute object.
Status Codes:

MFnData::Type MFnTypedAttribute::attrType ( MStatus ReturnStatus = NULL  )  const

Return the type of this attribute.

Parameters:
[out] ReturnStatus 
Returns:
An element of the MFnData::Type enum.
Status Codes:
  • MS::kSuccess The operation succeeded.
  • MS::kObjectDoesNotExist This instance is not bound to an MObject.
Examples:

MStatus MFnTypedAttribute::getDefault ( MObject defaultCustomData  ) 

Gets the default data for this attribute.

Parameters:
[out] defaultCustomData returns the default data for the attribute
Returns:
Return status.
Status Codes:
  • MS::kSuccess Operation successful.
  • MS::kFailure Invalid type for default data, or function does not have a valid object.

MStatus MFnTypedAttribute::setDefault ( const MObject defaultCustomData  ) 

Set the default data for this attribute. The data can be created using the appropriate data function set.

Parameters:
[in] defaultCustomData default data for the attribute
Returns:
Return status.
Status Codes:
  • MS::kSuccess Operation successful.
  • MS::kFailure Invalid type for default data, or function does not have a valid object.
Examples:

MObject MFnTypedAttribute::create ( const MString full,
const MString brief,
MFnData::Type  type,
MStatus ReturnStatus 
)

This method is obsolete. This method is not available in Python.

Deprecated:
Use the other MFnTypedAttribute::create method instead.
Create a new typed attribute with the given type.

Parameters:
[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.
Returns:
Pointer to the new attribute object.
Status Codes:


Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6