// =========================================================================== // 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. // =========================================================================== // This script captures several pieces of information from the system relevant to Maya and writes it to a text file: // - environment variables // - the graphics card + driver // - Viewport 2.0/OGS info // - the Maya cut ID and version // - the machine's operating system // - all plug-ins currently loaded in Maya global proc settingsSnapshot() { string $preferencesDirFile = `getenv MAYA_APP_DIR` + "/mayaSettingsSnapshot_" + `about -c` + ".txt"; string $vp2Info[] = `ogs -di`; string $mayaVersionInfo = `about -p` + " " + `about -v` + " " + `about -c`; string $osInfo = `about -os`; string $plugins[] = `pluginInfo -query -listPlugins`; string $currentDateAndTime = `about -cd` + " " + `about -ct`; // If a settings snapshot file already exists for this version of Maya, delete it first so we can replace it if (`exists $preferencesDirFile`){ sysFile -delete $preferencesDirFile; } // Write ENV VARS if (`about -os` == "win64"){ string $envVarList = `system("set > " + $preferencesDirFile)`; } if (`about -os` == "mac" || `about -os` == "linux64"){ string $envVarList = `system("env > " + $preferencesDirFile)`; } // Write other Maya information: Graphics card, driver, Viewport 2.0 info // Maya cut ID string and Maya version, the operating system and all plug-ins currently loaded $file = `fopen $preferencesDirFile "a"`; fprint $file ("\n"); fprint $file ("---/---/---/--- Operating System \n"); fprint $file ($osInfo + "\n"); fprint $file ("\n"); fprint $file ("---/---/---/--- Graphics Card, Driver and Viewport 2.0 information \n"); for ($i in $vp2Info){ fprint $file ($i); } fprint $file ("\n"); fprint $file ("---/---/---/--- Maya information \n"); fprint $file ($mayaVersionInfo + "\n"); fprint $file ("\n"); fprint $file ("---/---/---/--- Plug-ins currently loaded \n"); for ($j in $plugins){ fprint $file ($j + "\n"); } fprint $file ("\n"); fprint $file ($currentDateAndTime); fclose $file; print( "// Diagnostic information written to " + $preferencesDirFile + "\n" ); }