// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Description: // Save the given string in a global variable to allow future examination. // We should only ever get into this method if we're running a test, and we've // overriden the alias evalString. The alias evalString is defined in // defaultRunTimeCommands.mel as "alias evalString eval". // // In normal mode, evalString behaves like eval. This can be overriden in test // mode to avoid the evaluation of a costly method (eg, doing a batch render) // and instead capturing the intended command by calling the saveEvalString // method. See mayaBatchRenderTest.mel for an example usage of this method. // global proc saveEvalString( string $cmd ) // // Description: // Save the given string in a global variable to allow future examination. // { // Print the command that we're skipping, in the unlikely event that we // ever get in the wrong state and saveEvalString is called when eval // should really have been called. This would help track down what might // have appeared like a mysterious behaviour. // string $fmt = (uiRes("m_saveEvalString.kSkippingEval")); print( `format -s $cmd $fmt` ); global string $gSavedEvalString; $gSavedEvalString = $cmd; }