class MFnTypedAttribute

Jump to documentation

: public MFnAttribute Typed attribute function set. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnTypedAttribute < MFnAttribute < MFnBase

public members:

MFnTypedAttribute ()
MFnTypedAttribute ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnTypedAttribute ()
virtual MFn::Type type () const
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 )
OBSOLETE
MFnTypedAttribute ( const MObject & object, MStatus * ReturnStatus = NULL )

Inherited from MFnAttribute:

public members:

virtual MFn::Type type () const
enum DisconnectBehavior
kDelete
delete array element on disconnect (array attributes only)
kReset
reset the attribute to its default on disconnect
kNothing
do nothing to the attribute's value on disconnect
bool isReadable ( MStatus * ReturnStatus=NULL ) const
bool isWritable ( MStatus * ReturnStatus=NULL ) const
bool isConnectable ( MStatus * ReturnStatus=NULL ) const
bool isStorable ( MStatus * ReturnStatus=NULL ) const
bool isCached ( MStatus * ReturnStatus=NULL ) const
bool isArray ( MStatus * ReturnStatus=NULL ) const
bool indexMatters ( MStatus * ReturnStatus=NULL ) const
bool isKeyable ( MStatus * ReturnStatus=NULL ) const
bool isChannelBoxFlagSet ( MStatus * ReturnStatus=NULL ) const
bool isHidden ( MStatus * ReturnStatus=NULL ) const
bool isUsedAsColor ( MStatus * ReturnStatus=NULL ) const
bool isIndeterminant ( MStatus * ReturnStatus=NULL ) const
bool isRenderSource ( MStatus * ReturnStatus=NULL ) const
bool isDynamic ( MStatus * ReturnStatus=NULL ) const
bool isWorldSpace ( MStatus * ReturnStatus=NULL ) const
bool isAffectsWorldSpace ( MStatus * ReturnStatus=NULL ) const
DisconnectBehavior disconnectBehavior ( MStatus * ReturnStatus=NULL ) const
bool usesArrayDataBuilder ( MStatus * ReturnStatus=NULL ) const
bool internal ( MStatus * ReturnStatus=NULL ) const
MStatus setReadable ( bool state )
MStatus setWritable ( bool state )
MStatus setConnectable ( bool state )
MStatus setStorable ( bool state )
MStatus setCached ( bool state )
MStatus setArray ( bool state )
MStatus setIndexMatters ( bool state )
MStatus setKeyable ( bool state )
MStatus setChannelBox ( bool state )
MStatus setHidden ( bool state )
MStatus setUsedAsColor ( bool state )
MStatus setIndeterminant ( bool state )
MStatus setRenderSource ( bool state )
MStatus setWorldSpace ( bool state )
MStatus setAffectsWorldSpace ( bool state )
MStatus setDisconnectBehavior ( DisconnectBehavior behavior )
MStatus setUsesArrayDataBuilder ( bool state )
MStatus setInternal ( bool state )
bool accepts ( MFnData::Type type , MStatus * ReturnStatus=NULL ) const
bool accepts ( const MTypeId & id, MStatus * ReturnStatus=NULL ) const
MObject parent ( MStatus * ReturnStatus=NULL) const
MStatus setParent ( const MObject & parent )
MString name ( MStatus * ReturnStatus=NULL ) const
MString shortName ( MStatus * ReturnStatus=NULL ) const
MString getAddAttrCmd ( bool useLongName = false, MStatus * status=NULL ) const
public

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Function set for type attributes of dependency nodes.
Description

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.

Functions

MFnTypedAttribute:: MFnTypedAttribute ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnTypedAttribute:: MFnTypedAttribute ( MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnTypedAttribute:: MFnTypedAttribute ( const MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnTypedAttribute:: ~MFnTypedAttribute ()

Description

The class destructor.

MFn::Type MFnTypedAttribute:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kTypedAttribute

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

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.

Arguments

  • full full name for the new attribute
  • brief short name for the attribute
  • type type of the attribute's data
  • defaultData default data for the attribute
  • ReturnStatus return status

Return Value

  • pointer to the new attribute object

Status Codes

  • MS::kSuccess operation successful
  • MS::kInsufficientMemory out of memory
  • MS::kFailure bad type or default data

MObject MFnTypedAttribute:: create ( const MString & full, const MString & brief, const MTypeId & id, MObject defaultData, MStatus * ReturnStatus)
Description

Create a new typed attribute with the given type.

Arguments

  • full full name for the new attribute
  • brief short name for the attribute
  • id type id of the attribute's data
  • defaultData default data for the attribute
  • ReturnStatus return status

Return Value

  • pointer to the new attribute object

Status Codes

  • MS::kSuccess operation successful
  • MS::kInsufficientMemory out of memory
  • MS::kFailure bad type id or default data

MFnData::Type MFnTypedAttribute:: attrType ( MStatus * ReturnStatus) const

Description

Return the type of this attribute.

Arguments

  • ReturnStatus
    • MS::kSuccess the operation succeeded
    • MS::kObjectDoesNotExist this instance is not bound to an MObject

Return Value

  • an element of the MFnData::Type enum

MStatus MFnTypedAttribute:: getDefault ( MObject & defaultCustomData )
Description

Gets the default data for this attribute.

Arguments

  • defaultCustomData returns the default data for the attribute

Return Value

  • 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 )
Description

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

Arguments

  • defaultCustomData default data for the attribute

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure invalid type for default data, or function does not have a valid object

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

THIS IS AN OBSOLETE METHOD

This method will be removed in a future Maya release. Please use the other MFnTypedAttribute::create method for equivalent functionality.

Create a new typed attribute with the given type.

Arguments

  • full full name for the new attribute
  • brief short name for the attribute
  • type type of the attribute's data
  • ReturnStatus return status

Return Value

  • pointer to the new attribute object

Status Codes

  • MS::kSuccess operation successful
  • MS::kInsufficientMemory out of memory

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright