// =========================================================================== // 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 int mayaFileOptions ( string $parent, string $action, string $initialSettings, string $resultCallback ) // // Description: // This script posts the maya file accessor options. // // Parameters: // $parent - the elf parent layout for this options layout. It is // always a scrollLayout. // $action - the action that is to be performed with this invocation // of this proc. Valid options are: // "query" - construct the options string and pass it // to the resultCallback. // "post" - post all the elf controls. // $resultCallback - // This is the proc to be called with the result string. // resultCallback ( string $optionsString ) // // Returns: // 1 if successfull. // 0 otherwise. // { int $result = 0; string $currentOptions; string $optionList[]; string $optionBreakDown[]; int $index; if ($action == "post") { setParent $parent; setUITemplate -pushTemplate DefaultTemplate; columnLayout -adj true mayaVerboseCol; checkBoxGrp -label "" -label1 (uiRes("m_mayaFileOptions.kUseFullNamesForAttributes")) -ncb 1 -cw 2 260 mayaVerboseGrp; // Now set to current settings. $currentOptions = $initialSettings; if (size($currentOptions) > 0) { tokenize($currentOptions, ";", $optionList); for ($index = 0; $index < size($optionList); $index++) { tokenize($optionList[$index], "=", $optionBreakDown); if ($optionBreakDown[0] == "v") { if ($optionBreakDown[1] == "0") { checkBoxGrp -e -v1 0 mayaVerboseGrp; } else { checkBoxGrp -e -v1 1 mayaVerboseGrp; } } } } setUITemplate -popTemplate; $result = 1; } else if ($action == "query") { // Set verbose option if (`checkBoxGrp -exists mayaVerboseGrp` && `checkBoxGrp -q -value1 mayaVerboseGrp` == 1) { $currentOptions = $currentOptions + "v=1"; } else { $currentOptions = $currentOptions + "v=0"; } $currentOptions = $currentOptions + ";"; eval($resultCallback+" \""+$currentOptions+"\""); $result = 1; } return $result; }