global proc getFromPopup() { string $mayaFile = `file -q -loc`; string $jobTitle = basenameEx($mayaFile); string $projectConstant = ".mb"; string $imageDir = `substitute $projectConstant $mayaFile "/"`; string $perspCameras[] = `listCameras -p`; int $countCams = 0; string $activeCam = "selectCamerasOK()"; string $outputBroswer = "createOutputBrowserOK()"; string $activeLoc = "getOutputPathOK()"; string $printSelections = "print(getOutputPathOK())"; /** Create the UI **/ if (`window -q -exists choosing_win`) deleteUI choosing_win; window -menuBar true -maximizeButton false -title "Get From Popup" -w 400 -h 150 choosing_win; columnLayout; rowColumnLayout -numberOfRows 3; optionMenu -label "Camera" -cc $activeCam optMenu_Cam; while ($perspCameras[$countCams] != "") { menuItem -label $perspCameras[$countCams]; $countCams +=1; } textFieldButtonGrp -label "Render Directory" -fi $imageDir -bl "Browser" -bc $outputBroswer directoryField; button -label "Start Batch Vector Render" -c $printSelections; showWindow choosing_win; } global proc string selectCamerasOK() { string $camValue = `optionMenu -q -v optMenu_Cam`; // print($camValue+"\n"); return($camValue); } //bring up the directory browser global proc createOutputBrowserOK() { fileBrowserDialog -m 4 -fc "setOutputPathOK" -an "pick a folder" -ft "directory"; } //edit the textField to reflect the folder that has been picked. global proc string setOutputPathOK( string $filename, string $fileType ) { textFieldButtonGrp -e -fi $filename directoryField; return $filename; } global proc string getOutputPathOK() { string $filename; textFieldButtonGrp -q -tx directoryField; return $filename; }