MFnEnumAttribute

Base Class

MFnAttribute

Constants

None.

Static Methods

None.

Static Attributes

None.

Constructors

SignatureParametersDescription
MFnEnumAttribute()   Default constructor. Returns a new MFnEnumAttribute function set with no Maya object attached.
MFnEnumAttribute(object) object - MObject Returns a new MFnEnumAttribute function set, attached to the specified Maya object.

Object Methods

SignatureParametersReturnsDescription
addField(name, value) name - string
value - int
Reference to self. Add an item to the enumeration with the specified UI name and corresponding attribute value.
create(longName, shortName, defaultValue=0) longName - string
shortName - string
defaultValue - int
MObject Create a new enum attribute with the given longName, shortName and defaultValue, attach it to the function set and return it in an MObject.
fieldName(value) value - int string Returns the name of the enumeration item which has the given value.
fieldValue(name) name - string int Returns the value of the enumeration item which has the given name.
getMax()   int Returns the maximum value of all the enumeration items.
getMin()   int Returns the minimum value of all the enumeration items.
setDefaultByName(name) name - string Reference to self. Set the default value using the name of an enumeration item. Equivalent to attr.default = attr.fieldValue(name).

Object Attributes

NameTypeAccessDescription
default int RW Default value of attr.

Sequence Support

None.

Number Support

None.

Comparison Support

None.

© 2011 Autodesk, Inc. All rights reserved.