Retrieving Names Of Enum Attribute Items

Hi.

I need to store the names of all avaliable items of an enumeration attribute into a string array, so that I can build a popup menu containing those items.

I can't find a command, and "getAttr -as ..." only returns the name of the currently selected item :frowning:

Thanks in advance,

Daniel

QUOTE
names of .. items of an enumeration attribute
what do you mean?

Objects that have a special attribute?

take all objects and seek them for that attribute.
CODE
string $nameArray[];
string $all[] = ls;
for ($item in $all){
   if (attributeExists attribName $item){
       $nameArray[size($nameArray)] = $item;
   }
}
Or am I missunderstanding you? I'm not familiar with enumeration attributes.

No. I mean that I have a node which has an attibute which is an enumeration attribute, like the the lambert1.type.

I want a function like the getAllItems below:

CODE
string $array[] = getAllItems( lambert1.type );

optionMenu -label "Type for lambert1";

for(int $i = 0; $i < size($array); $i++ )
 menuItem -label $array[i] -c ("selectIndex(" + $i + ");");

Or some other way to make the contents of the enumeration attribute visible and selectable in the dagMenu (the one which pops up when you right click a node)

Thanks in advance,
Daniel

ls -type lambert;

TIP you can use ls -sl -st to show what type some selected node is

arghhh

nurbsSphereShape1.curvatureTolerance as in

sphere; 
getAttr -as nurbsSphereShape1.curvatureTolerance;
// Result: Medium Quality //

instead of lambert1.type.

CODE
sphere;
string $array[] = getAllItems(nurbsSphereShape1.curvatureTolerance);

optionMenu -label "Curve tolerance options for nurbsSphereShape1";

for(int $i = 0; $i < size($array); $i++ )
menuItem -label $array[i] -c ("selectIndex(" + $i + ");");

Thnx in advance,
Daniel

If attribute is custom you can use

CODE
addAttr -q -enumName nurbsSphere1.attribute;

Never mind, I wrote a new mel command (api).

Thanks anyway.

Was there an already existing solution to it?
__EDIT___
Nope, was not a dynamic one.
__/EDIT___

Regards,
Daniel