Attrenumoptionmenu Strange?

The small example in the docs about "attrEnumOptionMenu" works fine.

CODE
string $window = window;
columnLayout;
string $node = createNode opticalFX;
attrEnumOptionMenu -label "Glow Type" -attribute ($node + ".glowType");
showWindow $window;

But if you change the command into this, to call a procedure also:
CODE
attrEnumOptionMenu -cc "renderPreview" -label "Glow Type" -attribute ($node + ".glowType");

It only calls the procedure and does not change the attribute state.

Anything wrong here or with Maya.

WinXP, Maya 2008

Prashant

Do you mean the command is not working ??

but in Maya there is not renderPreview i think . if you give any other commands its working

or if you made any change in option box its not getting affected is it ??

"renderPreview" is custom procedure. You could do a simple check by using this:

CODE
global proc renderPreview(){
print "Here I come...";
}

string $window = window;
columnLayout;
string $node = createNode opticalFX;
attrEnumOptionMenu -cc "renderPreview" -label "Glow Type" -attribute ($node + ".glowType");
showWindow $window;

Prashant

Do you mean glowType is not changing ??

Or i am thinking in wrong way

Yes, glow type is not changing. Just give a try and let me know.

Prashant

theres nothing weird, if you define a cc then you must also set the values in the cc command. Its sort of a universal override.

QUOTE
theres nothing weird, if you define a cc then you must also set the values in the cc command. Its sort of a universal override.

I couldn't get you. Could you plz explain.

Prashant