// =========================================================================== // 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 getCacheFileCmd( int $version, string $cacheDirectory, string $args[] ) // // Description: // Create cache files on disk for the selected shape(s) according // to the specified flags described below. // // $version == 1: // $args[0] = time range mode: // time range mode = 0 : use $args[1] and $args[2] as start-end // time range mode = 1 : use render globals // time range mode = 2 : use timeline // $args[1] = start frame (if time range mode == 0) // $args[2] = end frame (if time range mode == 0) // // $version == 2: // $args[3] = cache file distribution, either "OneFile" or "OneFilePerFrame" // $args[4] = 0/1, whether to refresh during caching // $args[5] = skip, use $cacheDirectory argument // $args[6] = 0/1, whether to create a cache per geometry // $args[7] = name of cache file. An empty string can be used to specify that an auto-generated name is acceptable. // $args[8] = 0/1, whether the specified cache name is to be used as a prefix // // $version == 3: // $args[11] = simulation rate, the rate at which the cloth simulation is forced to run // $args[12] = sample mulitplier, the rate at which samples are written, as a multiple of simulation rate. // // $version == 4: // $args[13] = 0/1, whether modifications should be inherited from the cache about to be replaced. Valid // only when $action == "replace". // $args[14] = 0/1, whether to store doubles as floats // $version == 5: // $args[15] = cache format, { string $distrib = "OneFilePerFrame"; int $refresh = 1; int $perGeometry = 0; int $useAsPrefix = 0; float $simulationRate = 1.0; int $sampleMultiplier = 1; int $storeDoubleAsFloat = 0; string $cacheFormat = "mcc"; if ($version > 1) { $distrib = $args[3]; $refresh = $args[4]; $perGeometry = $args[6]; $useAsPrefix = $args[8]; } if ($version > 2) { if( size($args) > 11 ) { $simulationRate = $args[11]; } if( size($args) > 12 ) { $sampleMultiplier = $args[12]; } } if ($version > 3) { if( size($args) > 14 ) { $storeDoubleAsFloat = $args[14]; } } if ($version > 4) { if( size($args) > 15 ) { $cacheFormat = $args[15]; } } string $cacheCmd = "cacheFile "; if ($refresh) { $cacheCmd += ("-refresh "); } if ($cacheDirectory != "") { $cacheCmd += ("-directory \""+$cacheDirectory+"\" "); } if( !$perGeometry ) { $cacheCmd += ("-singleCache "); } if( $useAsPrefix ) { $cacheCmd += ("-prefix "); } if( $storeDoubleAsFloat ) { $cacheCmd += ("-doubleToFloat "); } $cacheCmd += ("-format "+$distrib+" "); $cacheCmd += (" -smr " + $simulationRate); $cacheCmd += (" -spm " + $sampleMultiplier); $cacheCmd += (" -cacheFormat \"" + $cacheFormat +"\" "); return $cacheCmd; }