// =========================================================================== // 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. // =========================================================================== proc int MASHcheckForPlugin() // Will return: // 0 if unable to load the MASH plug-in // 1 if it was already loaded // 2 if it had to be loaded { int $result = 0; if ( 0 == `pluginInfo -q -loaded "MASH"`) { loadPlugin "MASH"; if ( 0 != `pluginInfo -q -loaded "MASH"`); { $result = 2; } } else { $result = 1; } return $result; } global proc MASHexecuteProc( string $MASHproc) { int $result = MASHcheckForPlugin(); if ( 0 == $result) error (uiRes("m_MASHexecuteProc.kNoMASHPlugin")); // If we had to load the plug-in ourselves then we'll defer this proc because we // want to give it a chance to initialize, e.g. create new UI...source MEL files... if( 1 == $result) eval( $MASHproc); else evalDeferred( $MASHproc); }