Skip to content

Instantly share code, notes, and snippets.

@bitinn
Created August 23, 2017 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitinn/13f7b55a0aad3a6ba5dadecb48ef4351 to your computer and use it in GitHub Desktop.
Save bitinn/13f7b55a0aad3a6ba5dadecb48ef4351 to your computer and use it in GitHub Desktop.
TestScript.mel
// REMEMBER TO SOURCE THIS, NOT RUN IN THE SCRIPT EDITOR DIRECTLY
{
string $TEST_STRING = "TEST_STRING_#";
proc RunLocal1 () {
print($TEST_STRING);
}
proc RunLocal2 (string $Input) {
print($Input);
}
proc RunLocal3 () {
RunLocal2($TEST_STRING);
}
global proc RunGlobal () {
// uncomment this, click button, print "".
//RunLocal1();
// uncomment this, click button, error "Error evaluating argument at position 1 in procedure RunLocal2".
//RunLocal2($TEST_STRING);
// uncomment this, click button, Maya crashes.
//RunLocal3();
}
global proc CreateWindow () {
if (`window -exists "TestWindow"`) {
deleteUI "TestWindow";
}
window
-title "Test"
-sizeable 0
-maximizeButton 0
-widthHeight 200 100
"TestWindow";
string $TestButtons = `frameLayout
-collapsable 0
-labelVisible 0
"TestButtons"`;
rowColumnLayout -numberOfRows 1;
button
-label "Quick Test"
-command "RunGlobal";
showWindow "TestWindow";
}
CreateWindow();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment