PDA

View Full Version : enum attribute issues


X-Tender
05-31-2007, 11:11 AM
Hi,
I have following problem.
I have a Mesh which i give an enum attribute e.g.:
sphere -n mySphere;
addAttr -ln colors -at "enum" -en "Green:Blue:Red:Black:White" mySphere;
The values of the Enum I'am reading from an External FIle.
Now when I add more Values to the Text file (e.g. 2 more Colors) then I first check
if the attribute exists, when Yes then i delete the Attribute an dthen add the attribute again with the new values.
deleteAttr ("mySphere.colors");
addAttr -ln colors -at "enum" -en "Green:Blue:Red:Black:White:Orange:Purple" mySphere;

The problem is that it doesnt work if I do it in the script. But if i manualy execute
deleteAttr ("mySphere.colors");
and then
addAttr -ln colors -at "enum" -en "Green:Blue:Red:Black:White:Orange:Purple" mySphere;
then it works.

Did someone know the Issue and how to solve it? Or an workaround?

I use Maya 7.0

-XT

jiggyfresh
06-05-2007, 12:51 AM
is it not working in the sense that you are not getting the desired result or are you getting any runtime/syntax errors?

if it does not execute then i would suggest adding "`" around the commands, but that's a syntaxical thing and if your script is running, then it's another problem.

CGTalk Moderation
06-05-2007, 12:51 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.