// =========================================================================== // 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: 3 Februrary 2004 // global proc doTruncateHairCache() { // Make sure that we have a fluid selected // or warn the user and fail string $selectedHairSystems[] = `getSelectedHairSystems`; if( size( $selectedHairSystems ) == 0 ) { warning(uiRes("m_doDeleteHairPB.kNoHairSystemSelected")); return; } if( !`exists hairPlaybackCaches_disableUnselected` ) { source "hairPlaybackCaches.mel"; } int $oldEnable = `getAttr globalCacheControl.writeEnable`; string $disabledCaches[] = `hairPlaybackCaches_disableUnselected`; setAttr globalCacheControl.writeEnable 1; for( $hairShape in $selectedHairSystems ) { if(`connectionInfo -id ($hairShape + ".diskCache")` > 0 ) { // FIX_LATER ? // // if( !fluidDiskCacheHasLocalCopy() ) { // return; // } truncateHairCache $hairShape; } } setAttr globalCacheControl.writeEnable $oldEnable; hairPlaybackCaches_enable( $disabledCaches ); }