// =========================================================================== // 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. // =========================================================================== // Description: This procedure is called to select // the bin buttons corresponding to the selected bins. // proc markSelectedBins(string $gridLayout) { global string $gHyperShadeSelectedBinList[]; if (size($gHyperShadeSelectedBinList) == 0) { // Nothing is selected. // return; } // Mark the bin buttons associated to the selected bins. // for ($binName in $gHyperShadeSelectedBinList) { markOneBinUI($binName, $gridLayout, true); } } // Description: This procedure is called to refresh the bins UI // in hyper shade. // global proc refreshHyperShadeBinsUI(string $parentForm, int $forceRebuild) { global int $gNoHyperShadeRefreshForBinRename; if ($gNoHyperShadeRefreshForBinRename) { // Do not refresh hyper shade bin UI. // Reset the $gNoHyperShadeRefreshForBinRename variable. // $gNoHyperShadeRefreshForBinRename = false; return; } string $oldParent = `setParent -q`; string $parent = `setParent $parentForm`; // If the bin UIs are not created yet, create it. // if (!`gridLayout -exists binsGridLayout`) { catch( hyperShadeBinsUI($parent) ); setParent $oldParent; return; } // Update the bin list. // updateHyperShadeBinList(); setParent "binsGridLayout"; string $gridLayout = `setParent -q`; string $buttonList[] = `gridLayout -query -childArray $gridLayout`; if ($forceRebuild) { if (size($buttonList) != 0) { // Delete existing bin buttons. // string $button; for ($button in $buttonList) { deleteUI $button; } } // Add buttons for bins. // string $defaultBin = (uiRes("m_hyperShadeBinsUI.kMasterBin")); addNewBinUI($defaultBin, $gridLayout, true); string $bin; string $binListString = `getAttr defaultRenderGlobals.hyperShadeBinList`; if ($binListString != "") { string $binListArray[]; tokenize($binListString, ";", $binListArray); for ($bin in $binListArray) { addNewBinUI($bin, $gridLayout, false); } } // Mark selected bins. // markSelectedBins($gridLayout); } else if (size($buttonList) == 0) { // No master bin yet. Add buttons for bins. // string $defaultBin = (uiRes("m_hyperShadeBinsUI.kMasterBin")); addNewBinUI($defaultBin, $gridLayout, true); } setParent $oldParent; }