// =========================================================================== // 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: // Connect an existing cacheFile node to an existing blend node. // If the no objects are specified, connect the first channel // of the cache file node to the first object controlled by the blend. // If an array of objects and channels is specified, connect to // the blend such that there is a one-to-one correspondence between // the specified objects and the specified cache channel. // global proc string doFluidCacheConnect( string $cacheBlend, string $cacheFileNode, string $channels[] ) { if (size($channels) == 0) { cacheFileCombine -keepWeights -e -connectCache $cacheFileNode $cacheBlend; } else { int $ii, $channelCount = size($channels); string $combineCmd = "cacheFileCombine -keepWeights "; for ($ii = 0; $ii < $channelCount; $ii++) $combineCmd += (" -cnm \"" + $channels[$ii] + "\"" ); $combineCmd += (" -e -connectCache "+$cacheFileNode); $combineCmd += (" "+$cacheBlend); eval $combineCmd; } return $cacheFileNode; }