You don't want to query the current enumAttr value, you want to query all their names:
Tip from my buddy Te:
Or, via PyMel's Attribute.getEnums() method:
(Modified example from the PyMel docs):
string $enumAttrs = `addAttr -q -enumName "myNode.myEnumAttr"`;This returns a single string of attr names separated by colons:
"enumA:enumB:enumEct"
Tip from my buddy Te:
string $enumAttrs[] = `attributeQuery -node "myNode" -listEnum "myEnumAttr"`;This returns an array, with a single string value separated by colons:
{"enumA:enumB:enumEct"}
Or, via PyMel's Attribute.getEnums() method:
(Modified example from the PyMel docs):
>>> from pymel.core.general import Attribute >>> addAttr( "persp", ln='numbers', at='enum', enumName="zero:one:two:thousand=1000:three") >>> numbers = Attribute('persp.numbers').getEnums() >>> sorted(numbers.items()) [(u'one', 1), (u'thousand', 1000), (u'three', 1001), (u'two', 2), (u'zero', 0)] >>> numbers[1] u'one' >>> numbers['thousand'] 1000Note, PyMel will raise a
TypeError
of the enum has no values.