// =========================================================================== // 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: Oct, 2003 // // Procedure Name: // assumeRetargetRestPose // // Description: // Restore a dagPose which stores the neutral position of a skeleton // hierarchy. // // Return Value: // none // proc int assumeTheRestPose(string $obj) { string $foundPose; string $previousPoses[] = `listConnections -type dagPose $obj`; for ($ppose in $previousPoses) { string $attrExists[] = `ls ($ppose+".currentRestPose")`; if (size($attrExists)) { $foundPose = $ppose; break; } } if (size($foundPose) == 0) { string $errMsg = (uiRes("m_assumeRetargetRestPose.kNoNeutralPose")); $errMsg = `format -s $obj $errMsg`; error($errMsg); } string $cmd = ("dagPose -restore -global -name "+$ppose); evalEcho $cmd; return 1; } global proc assumeRetargetRestPose() { string $sl[] = `ls -sl -type transform`; string $errMsg = (uiRes("m_assumeRetargetRestPose.kSelectRootNodeError")); if (size($sl) == 0) { error($errMsg); } int $count = 0; for ($obj in $sl) { $count += assumeTheRestPose($obj); } if ($count == 0) { error($errMsg); } }