PDA

View Full Version : mel strings strings strings!.. small question about strings!


Kerusi
01-06-2009, 06:29 AM
hi guys, i'm developing a small ui to create some custom attributes and tools that i use frequently. I encountered a problem when i tried to combine my strings together,i think it is caused by my brackets . I hope you guys can help me out with this.

button -c ( "addAttr -ln kus_rot0 -dt vectorArray $nodeName;" +
"addAttr -ln kus_rot -dt vectorArray $nodeName;" +
"setAttr -e -keyable true ($nodeName +".kus_rot");")-l custom rotation;


tried to use the wiggly brackets =p, or the square brackets but it doesn;t work.Is there any other way to separate these strings into separate lines? i want to assign a button to create a series of custom attributes and it will end up very long .

edit>added the code box.

shibumenon
01-06-2009, 08:46 AM
the button command doesn't work because of the quotes within quotes in this line:
"setAttr -e -keyable true ($nodeName +".kus_rot");")
If you need to use quotes within a quoted statement, the inner quotes have to be preceeded with a '\' . This combination of \" is called an escape sequence
The following should work fine:
"setAttr -e -keyable true ($nodeName + \".kus_rot\");")
You might also want to add a space to the end of each line within quotes

Kerusi
01-07-2009, 12:16 AM
ah,escape sequence! I think I learned it before in books. Totally forgotten about it! will try to revise my basics more often! Thanks again

CGTalk Moderation
01-07-2009, 12:16 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.