// =========================================================================== // 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 create a new bin. // global proc string hyperShadeCreateNewBin( string $gridLayout, string $suggestedBinName) { // Make up a default bin name. // string $binName; int $index = 0; if ($suggestedBinName == "") { // Bin name will be used as node name and doesn't need to be translated here $suggestedBinName = "untitled bin" ; } while (true) { // Make up an bin name. // $binName = $suggestedBinName; if ($index != 0) { $binName = $binName + " " +$index; } // Check if this name exists. // if (!binNameExistsInHyperShadeBinList($binName)) { // This make up name is a unique bin name. Use it. // break; } $index++; } // Add the bin button to the UI. // addNewBinUI($binName, $gridLayout, false); // Add the new bin in the bin list. // addBinsToHyperShadeBinList({$binName}); return $binName; }