// =========================================================================== // 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. // =========================================================================== // // Proceduce Name: // doReplaceNclothCacheFrames // // Description: // Replace cache frames as specified by options // // Input Arguments: // Lots // // Return Value: // None // global proc doReplaceNclothCacheFrames( int $timeMode, float $startTime, float $endTime, int $replaceFramesWithSimulation, int $interpType, float $interpStart, float $interpEnd, string $inTangent, string $outTangent, string $rename, float $simRate, int $sampleMult, int $noBackups ) { string $obj; string $cmd = "cacheFile -refresh -replaceCachedFrame"; string $objects[]; if( $replaceFramesWithSimulation ) { $objects = getNclothObjectsToCache(1); for( $obj in $objects ) { $cmd += (" -cacheableNode " + $obj); } } else { $objects = getGeometriesToCache(); if( size($objects) == 0 ){ error((uiRes("m_doReplaceNclothCacheFrames.kNoGeometryError"))); } for( $obj in $objects ) { $cmd += (" -points " + $obj); } } if( $interpType != 1 ) { $cmd += (" -interpStartTime " + $interpStart ); $cmd += (" -interpEndTime " + $interpEnd ); $cmd += (" -inTangent " + $inTangent); $cmd += (" -outTangent " + $outTangent ); if( $interpType == 3 ) { $cmd += (" -fileName \"" + $rename + "\""); } } if( $timeMode == 1 ) { $startTime = `currentTime -q`; $endTime = $startTime; } $cmd += (" -startTime " + $startTime ); $cmd += (" -endTime " + $endTime ); $cmd += (" -simulationRate " + $simRate ); $cmd += (" -sampleMultiplier " + $sampleMult ); if( $noBackups ) { $cmd += " -noBackup"; } string $cacheFiles[] = `ls -sl -type cacheFile`; if( size($cacheFiles) == 1 ) { $cmd += (" -cacheFileNode " + $cacheFiles[0] ); } evalEcho($cmd); }