// =========================================================================== // 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: 21 Nov 2001 // // Description: // This is a helper script to perform the "diskCache -append" command // using the corresponding option box values. // global proc doAppendHairCache( int $version, string $args[] ) { if(( $version < 1 ) || ( size( $args ) < 5 )) { error( (uiRes("m_doAppendHairCache.kIncorrectVersion")) ); return; } float $startTime = 0.0; float $endTime = 0.0; int $timeMode = $args[0]; switch( $timeMode ) { case 1: $startTime = `currentTime -q`; $endTime = `currentTime -q`; break; case 2: $startTime = `currentTime -q`; $endTime = `playbackOptions -q -max`; break; case 3: $startTime = `playbackOptions -q -min`; $endTime = `playbackOptions -q -max`; break; case 4: default: $startTime = $args[1]; $endTime = $args[2]; break; } string $overSample = "\"\" "; if( $args[3] == "1" ) { $overSample = "\"-overSample\" "; } string $cmd = ""; if( $startTime > $endTime ) { error((uiRes("m_doAppendHairCache.kEndTimeError"))); } else { $cmd = ( "hairPlaybackCaches_append " + $startTime + " " + $endTime + " " + $overSample + $args[4] ); } evalEcho( $cmd ); } source "hairPlaybackCaches.mel";