People of knowledge, please help me to understand this: In Maya LT 2017 + macOS, I have following test script: https://gist.github.com/bitinn/13f7b55a0aad3a6ba5dadecb48ef4351 In full: // REMEMBER TO SOURCE THIS, NOT RUN IN THE SCRIPT EDITOR DIRECTLY
{ string $TEST_STRING = "TEST_STRING_#"; proc RunLocal1 () {…
I believe this is the only safe alternative (to using global/local variables). If you are using MEL script, good luck trying to share a variable across procedures! (It would work in your script editor, but as soon as you try to invoke global proc through UI, as "-command" requires global proc, shits goes down because of…
Saying global variables are bad is like saying script Jobs are bad. Neither are bad... Neither are a failure. Global Variables do not kill people or cause bugs yadda yadda... Any tech artist of any worth leverages as much to great advantage when appropriate. Stop speading this myth! They are a consideration not a sin!…
Final words from Autodesk: you can't use an anonymous {} to fake a block scope man, that's against the rules! - So (1) me getting OP's script to work is a bug in MEL. - And (2) Autodesk senior engineer advise the solution is to use global variable, even though we programmers and the Maya doc both agree global variables are…
I know I'm reviving an old post here but I would like to thank you bitinn I've encountered the same exact bug while working on a script these past few days and it caused some serious headache! I'm new to programming, so a lot of things are still beyond me, but like yourself I usually prefer to encapsulate everything within…