// =========================================================================== // 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 check if a bin name exists // in the hyper shade bin list. // Return true if the given bin name exists in the hyper shade bin // list. Otherwise, return false. // global proc int binNameExistsInHyperShadeBinList(string $binName) { // Check if the bin name is a valid bin name. // if (!isValidBinName($binName)) { return false; } string $binList = `getAttr defaultRenderGlobals.hyperShadeBinList`; // It is assumed that the bin names are separated by ";". For // example "wood;metal;outdoors". // // Check if the bin name is the only item in the bin list. // if ($binName == $binList) { return true; } // Check if the bin name occurred at the beginning of the bin list. // if (`substitute ("^"+$binName+";") $binList ""` != $binList) { return true; } // Check if the bin name occurred at the end of the bin list. // if (`substitute (";"+$binName+"$") $binList ""` != $binList) { return true; } // Check if the bin name occurred at the middle of the bin list. // if (`substitute (";"+$binName+";") $binList ""` != $binList) { return true; } return false; }