// =========================================================================== // 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: 20 Feb 2002 // // Description: // Clear Initial State // // proc string clearFluidICCache( string $fluid, int $deleteCacheFile ) { string $dskC; if(`connectionInfo -id ($fluid + ".diskCacheIC")` > 0 ) { string $src = `connectionInfo -sfd ($fluid + ".diskCacheIC")`; string $buffer[]; tokenize($src, ".", $buffer); $dskC = $buffer[0]; deleteFluidCache( $dskC, $deleteCacheFile ); } return $dskC; } proc clearActiveFluidICCaches( int $deleteFile ) { string $fluidShapes[] = `getActiveFluidShapes`; for( $fluid in $fluidShapes ) { clearFluidICCache( $fluid, $deleteFile ); } } global proc doDeleteFluidsIC( int $version, string $args[] ) // // Description: // // { if(( $version < 1 ) || ( size( $args ) < 1 )) { error(uiRes("m_doAppendHairCache.kIncorrectVersion")); return; } int $deleteFile_unused = $args[0]; // Make sure that we have a fluid selected // or warn the user and fail // string $fluidShapes[] = getActiveFluidShapes(); if( size($fluidShapes) == 0 ) { error((uiRes("m_doDeleteFluidsIC.kSelectFluid"))); return; } // make sure that we know where the Fluids Cache goes verifyWorkspaceFileRule( "diskCache", "data" ); artFluidAttrICCacheSaved; clearActiveFluidICCaches false; }