class MFnEnumAttribute

Jump to documentation

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

Inheritance:

MFnEnumAttribute < MFnAttribute < MFnBase

public members:

MFnEnumAttribute ()
MFnEnumAttribute ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnEnumAttribute ()
virtual MFn::Type type () const
MObject create ( const MString & fullName, const MString & briefName, short defaultValue = 0, MStatus * ReturnStatus = NULL )
MStatus addField ( const MString & fieldString, short index)
MString fieldName ( short index, MStatus *ReturnStatus = NULL ) const
short fieldIndex ( const MString & fieldString, MStatus *ReturnStatus = NULL ) const
MStatus getMin ( short& minValue ) const
MStatus getMax ( short& maxValue ) const
MStatus setDefault ( short index )
MStatus setDefault ( const MString &fieldString )
MStatus getDefault ( short &index ) const
MString defaultValue ( MStatus * ReturnStatus = NULL ) const
MFnEnumAttribute ( const MObject & object, MStatus * ReturnStatus = NULL )
MStatus getDefault ( MString &fieldString ) const
NO SCRIPT SUPPORT

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 enumerated attributes.
Description

Function set for enumerated attributes. These attributes accept fields as input. Each field consists of a short and its associated string, which is a descriptive name for the field.

Functions

MFnEnumAttribute:: MFnEnumAttribute ()

Description

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

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

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

MFnEnumAttribute:: ~MFnEnumAttribute ()

Description

The class destructor.

MFn::Type MFnEnumAttribute:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kEnumAttribute

MObject MFnEnumAttribute:: create ( const MString & fullName, const MString & briefName, short defaultValue , MStatus * ReturnStatus )

Description

Creates an enumerated attribute object.

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

  • fullName The full name of the attribute
  • briefName The brief name of the attribute
  • defaultValue The default value of the attribute
  • ReturnStatus Status code for the operation.

Return Value

  • The newly created enumerated attribute object.

Status Codes

  • MS::kSuccess The attribute object was successfully created.
  • MS::kInsufficientMemory There is no more memory

MString MFnEnumAttribute:: fieldName ( short index, MStatus *ReturnStatus ) const

Description

Retrieve the string associated with a given index

Arguments

  • index The index of the string to look up
  • ReturnStatus Status code for the operation.

Return Value

  • The descriptive string corresponding to the given index

Status Codes

  • MS::kSuccess The attribute object was successfully created.
  • MS::kInvalidParameter The index is out of range
  • MS::kObjectDoesNotExist the attribute is not bound to an MObject

MStatus MFnEnumAttribute:: addField ( const MString &fieldString, short index)

Description

Add a field (a string/index pair) to the enumeration

Arguments

  • fieldString The string describing the field
  • index The index of the field

Return Value

  • Status code for the operation

Status Codes

  • MS::kSuccess The field was successfully added
  • MS::kInvalidParameter The passed index is already being used
  • MS::kObjectDoesNotExist The attribute is not bound to an MObject

short MFnEnumAttribute:: fieldIndex ( const MString & fieldString, MStatus *ReturnStatus ) const

Description

Retrieve the index associated with a given string.

Arguments

  • fieldString The string describing the field.
  • ReturnStatus Status code for the operation.

Return Value

The index associated with the given descriptive string.

Status Codes

  • MS::kSuccess The operation was successfully performed
  • MS::kObjectDoesNotExist the attribute is not bound to an MObject

MStatus MFnEnumAttribute:: getMin ( short& minValue ) const

Description

Return the minimum value for this attribute.

Arguments

  • minValue the minimum value for this attribute

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kFailure the attribute does not have a minimum
  • MS::kObjectDoesNotExist this instance is not bound to an MObject

MStatus MFnEnumAttribute:: getMax ( short& maxValue ) const

Description

Return the maximum value for this attribute.

Arguments

  • maxValue the maximum value for this attribute

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kFailure the attribute does not have a maximum
  • MS::kObjectDoesNotExist this instance is not bound to an MObject

MStatus MFnEnumAttribute:: getDefault (short &index) const
Description

Get the default value for the enum attribute.

Arguments

  • index default index value.

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kObjectDoesNotExist this attribute is not bound to an MObject
  • MS::kInvalidParameter this attribute is not an enum

MStatus MFnEnumAttribute:: getDefault ( MString &fieldString) const
Description

Get the default value for the enum attribute.

Python Notes

This method is not supported in Python. Please see defaultValue()

Arguments

  • fieldString the string value for the default enum

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kObjectDoesNotExist this attribute is not bound to an MObject
  • MS::kInvalidParameter this attribute is not an enum

MString MFnEnumAttribute:: defaultValue ( MStatus * ReturnStatus) const
Description

Get the default value for the enum attribute.

Arguments

  • ReturnStatus Optional status code. See below.

Return Value

  • the string value for the default enum

Status Codes

  • MS::kSuccess the operation succeeded
  • MS::kObjectDoesNotExist this attribute is not bound to an MObject
  • MS::kInvalidParameter this attribute is not an enum

MStatus MFnEnumAttribute:: setDefault ( short index )

Description

Set a new default value for this enum attribute.

Arguments

  • index new the default value for this attribute

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kObjectDoesNotExist this attribute is not bound to an MObject
  • MS::kInvalidParameter this attribute is not a enum attribute, or the given index value is not valid.

MStatus MFnEnumAttribute:: setDefault ( const MString &fieldString )

Description

Set a new default value for this enum attribute.

Arguments

  • fieldString new the default value for this attribute

Return Value

  • MS::kSuccess the operation succeeded
  • MS::kObjectDoesNotExist this attribute is not bound to an MObject
  • MS::kInvalidParameter this attribute is not a enum attribute, or the given string value does not exist in the enum

This class has no child classes.


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