// =========================================================================== // 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: May, 2006 // // Procedure Name: // doDeleteNClothHistory // // Description: // Delete ncloth history. // // Input Arguments: // $version: The version of this option box. Used to know how to // interpret the $args array. // // $args // Version 1 // $args[0] : action: "pre" = preDeformers // "preCache" = preCache // // Return Value: // None // global proc doDeleteNClothHistory( string $version, string $args[] ) { string $currentSelection[] = getNclothObjectsToCache(0); if (size($currentSelection) == 0) { error((uiRes("m_doDeleteNClothHistory.kSelectClothError"))); } string $mode = $args[0]; for ($selObj in $currentSelection) { string $meshConns[] = `listConnections -type mesh -shapes 1 ($selObj+".inputMesh")`; if (size($meshConns) > 0) { string $cmd = "bakePartialHistory"; if ($mode == "preCache") { $cmd += (" -preCache "+$meshConns[0]); } else { $cmd += (" -pre "+$meshConns[0]); } eval $cmd; } } }