During debugging of MEL scripts, it's a constant nuisance to get errors about objects already being loaded, variables already assigned, etc.
Is there a way to "initialize" the maya environment to the state it was in before a script was run? I don't want the scene/objects to clear as with a File/NewScene command--just to clear out any changes that may have been made such as new functions being added, variables being assigned......?
I don't think so.... once you define a variable, it sits in memorty until you quit and restart. Going forward however, if you're working from say, the Script editor, embed all your commands in curly braces, that way Maya will forget about them after the execution. Like:
{
float $asdf = 1.0;
do something;
}
After execution, Maya won't know what $asdf is... That's your best bet I believe. I'd love to hear otherwise ![]()