Hey everyone,
I've been teaching myself MEL scripting but I'm sort of stuck on a particular syntax. I've searched all over for my specific problem but I'm not sure which key words I should be searching for and can't find anything, so thank you in advance to anyone who can help.
I have a button setup with a command within parentheses, however this seems to only be good for a single command. The portion of code in bold is what I'm having issues with. I need to keep this parenthetical format but also have it work with two or more commands. An example would be to have the command delete $materials[$i] as well as print "Deleted " + $material [$i];
button -label "D" -bgc .5 0 0 -command [B]( "delete " + $materials[$i] )[/B];
Normally I would just put the whole command inside quotations, however doing so seems to break the scope of my variables which kicks out an error about how $materials and/or $i are undefined.
Replies
Below is an operable chunk of my code if that helps anyone better understand what I'm trying to accomplish.
The line in green has the exact same syntax as the line in orange; they both work just fine as is, but my hangup is getting the orange line to contain multiple commands using the same syntax: for instance, having it print two separate times.
You should just be able to throw this into Maya's Script Editor and run/edit it that way.
global proc testing(){print "words \n"; print "more words";}
print (`testing`);