class MFnGenericAttribute

Jump to documentation

: public MFnAttribute Generic attribute function set

Inheritance:

MFnGenericAttribute < MFnAttribute < MFnBase

public members:

MFnGenericAttribute ()
MFnGenericAttribute ( MObject & object, MStatus * ReturnStatus = NULL )
MFnGenericAttribute ( const MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnGenericAttribute ()
virtual MFn::Type type () const
MObject create ( const MString & full, const MString & brief, MStatus * ReturnStatus = NULL )
MStatus addAccept ( MFnData::Type newType )
MStatus addAccept ( MFnNumericData::Type newType )
MStatus addAccept ( const MTypeId & id )
MStatus removeAccept ( MFnData::Type oldType )
MStatus removeAccept ( MFnNumericData::Type oldType )
MStatus removeAccept ( const MTypeId & id )

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

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 generic attributes of a dependency node
Description

MFnGenericAttribute is a function set for attributes that can accept several types of data. A generic attribute is similar to a typed attribute (MFnTypedAttribute) except that it has a list of types that it considers valid.

If the attribute will only take one type of data then it is more efficient to use one of the other attribute function sets such as MFnTypedAttribute or MFnNumericAttribute.

Functions

MFnGenericAttribute:: MFnGenericAttribute ()

Description

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

MFnGenericAttribute:: MFnGenericAttribute ( 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

MFnGenericAttribute:: MFnGenericAttribute ( 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

MFnGenericAttribute:: ~MFnGenericAttribute ()

Description

The class destructor.

MFn::Type MFnGenericAttribute:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kGenericAttribute

MObject MFnGenericAttribute:: create ( const MString & full, const MString & brief, MStatus * ReturnStatus )
Description

Creates a new generic attribute.

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 int name of the attribute
  • short short name of the attribute

Return Value

  • return status

Status Codes

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

MStatus MFnGenericAttribute:: addAccept ( MFnData::Type newType )
Description

Add a new connection type that this attribute can accept.

Arguments

  • newType new type

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the add failed

MStatus MFnGenericAttribute:: addAccept ( MFnNumericData::Type newType )
Description

Add a new connection type that this attribute can accept.

Arguments

  • newType new type

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the add failed

MStatus MFnGenericAttribute:: addAccept ( const MTypeId & id )
Description

Add a new connection type that this attribute can accept. This method takes the type id (iff tag) of the data objects that can be accepted.

Arguments

  • newType id of new type

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the add failed

MStatus MFnGenericAttribute:: removeAccept ( MFnNumericData::Type oldType )
Description

Remove one of the types that this attribute can accept.

Arguments

  • oldType old type that is no longer accepted

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the remove failed

MStatus MFnGenericAttribute:: removeAccept ( MFnData::Type oldType )
Description

Remove one of the types that this attribute can accept.

Arguments

  • oldType old type that is no longer accepted

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the remove failed

MStatus MFnGenericAttribute:: removeAccept ( const MTypeId & id )
Description

Remove one of the types that this attribute can accept. This method takes the type id (iff tag) of the data objects that can no longer be accepted.

Arguments

  • id id of old type that is no longer accepted

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have valid object, or the remove failed

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright