Created
August 23, 2017 04:18
-
-
Save bitinn/13f7b55a0aad3a6ba5dadecb48ef4351 to your computer and use it in GitHub Desktop.
TestScript.mel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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