// =========================================================================== // 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. // =========================================================================== global proc launchFcheck ( int $sequence ) //Description // This procedure launches fcheck to view an image or a sequence // $sequence = 0 is an image // $sequence = 1 is a sequence { //check the stored optionVar for the path to look in first if (!`optionVar -exists "launchFcheckPath"`){ string $workspace = `workspace -query -directory`; optionVar -stringValue "launchFcheckPath" ($workspace + "*.*"); } //query the optionVar string $filePath = `optionVar -query launchFcheckPath`; //let the user specify the image or sequence to view string $fileName = `fileDialog -directoryMask $filePath`; if ($fileName != ""){ launchFcheckCmd $fileName $sequence; //change the optionVar to the latest image so we look in the //right place next time int $numPathComponents;//number of pieces to the file path string $filePathBuffer[];//break the file path into pieces $numPathComponents = `tokenize $fileName "/" $filePathBuffer`; string $newFilePath; //reassemble the path to the selected file without the fileName int $i; if (`substring $fileName 1 1` == "/") $newFilePath += "/"; for ($i = 0; $i < ($numPathComponents - 1); $i++){ $newFilePath += $filePathBuffer[$i]; $newFilePath += "/"; } //finish the path with a wildcard $newFilePath += "*.*"; //set the optionVar optionVar -stringValue "launchFcheckPath" $newFilePath; } }