// =========================================================================== // 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: Nov 2014 // // Description: // This is a helper script to perform the replace cache frames depending // on the object type. // // // Procedure Name: // performReplaceCacheFrames // // Description: // Perform the command using the corresponding replace cache frames command // depending on the selected object to cache type. // // Input Arguments: // 0 - Execute the command. // 1 - Show the option box dialog. // 2 - Return the command. // // Return Value: // None. // global proc string performReplaceCacheFrames(int $action) { string $fluObjs[] = getFluidObjectsToCache(0); // Don't show error string $nClothObjs[] = getNclothObjectsToCache(0); // Don't show error if ((size($fluObjs) > 0) && (size($nClothObjs) == 0)){ return performReplaceFluidCacheFrames($action); } if ((size($nClothObjs) > 0) && (size($fluObjs) == 0)){ return performReplaceNclothCacheFrames($action); } if ($action == 1) { error((uiRes("m_performReplaceCacheFrames.kNeedObjectTypeForReplaceCacheFramesOptionError"))); } else{ error((uiRes("m_performReplaceCacheFrames.kSelectObjectToCacheError"))); } return ""; }