// =========================================================================== // 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. // =========================================================================== // // // Creation Date: 2005 // // Description: // // global proc int getCacheCanBeReplaced(string $objsToCache[]) { // we can only replace the cache if there is a single one // active, not if there are many // string $format; $format = (uiRes("m_getCacheCanBeReplaced.kObjHasMoreThanOneCache")); for ($obj in $objsToCache) { string $cacheBlend[] = `cacheFileCombine -q -ln $obj`; for ($cb in $cacheBlend) { string $bcs[] = `cacheFileCombine -q -cc $cb`; if (size($bcs) > 1) { int $numActive = 0; for( $cache in $bcs ) { if($numActive > 1 ) { break; } else if(`getAttr ($cache+".enable")`) { $numActive++; } } // If we have more than one active cache, throw error if( $numActive > 1 ) { string $errMsg = `format -stringArg $obj $format`; error($errMsg); return 0; } } } } return 1; }