// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Nov 6 2012 // // Description: // A helper procedure to open a file. Primarily used by Maya internally // // Arguments: // $file - the file to open. // $menuParent - is the parent window. // global proc doOpenFile (string $file) { global string $gOperationMode; // Make sure we get the full path to the file // string $full = $file; // If MAYA_PROJECT has been specified then $file is either a full // path or relative to MAYA_PROJECT so do not try to convert to // to a full path // string $proj = getenv ("MAYA_PROJECT"); if ($proj == "") { python ("import os"); $full = python ("os.path.abspath(\"" + $file + "\")"); } $gOperationMode = "Open"; pv_performAction (fromNativePath($full), "Best Guess"); }