// =========================================================================== // 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 string doCacheAttach( string $switchNodes[], string $fileDirFlag, string $attributes[], string $channels[] ) { int $channelCount = size($channels); int $attrCount = size($attributes); string $attachCmd = ( "cacheFile -attachFile " + $fileDirFlag ); for( $ii = 0; $ii < $channelCount; $ii++ ) { $attachCmd += (" -cnm \"" + $channels[$ii] + "\""); } for( $ii = 0; $ii < $attrCount; $ii++ ) { $attachCmd += (" -ia " + $attributes[$ii]); } string $cacheFile = `evalEcho $attachCmd`; int $objCount = size($switchNodes); for ($ii = 0; $ii < $objCount; $ii++) { string $playFromCachePlug = $switchNodes[$ii] + ".playFromCache"; connectAttr ($cacheFile+".inRange") $playFromCachePlug; if(nodeType( $switchNodes[$ii] ) == "nParticle") { string $arrayPlug = $switchNodes[$ii] + ".cacheArrayData"; connectAttr ($cacheFile+".outCacheArrayData") $arrayPlug; } } return $cacheFile; }