// =========================================================================== // 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 Aug 1998 // // Procedure Name: // newSkinCluster // // Description: // Creates a skinCluster // proc int hasSingleBindPoseMovedOrExistsMultipleBindPoses(string $jointName) { int $result = 0; // Get all bindPose-based connections to this joint // string $bindPoseConnections[] = `dagPose -q -bindPose $jointName`; // Cases: // - If at the joint there is one bindPose connection, then either the pose // changed or remained at pose // - If at the joint there are two or more bindPose connections // then there are multiple bind poses at the joint if (size($bindPoseConnections)>0) { string $bindPoses[] = eval("dagPose -q -atPose " + $bindPoseConnections[0]); if (size($bindPoses) > 0) { $result=1; } } return $result; } proc int validateMultipleBindPoses() { int $result=1; string $cmd = "ls -selection -type joint"; string $joints[]=eval($cmd); for ($i=0;$i 1) { for ($ii = 1; $ii < size($buff); $ii+=2) { if ($buff[$ii] == "multipleBindPose") { $allowMultipleBindPoses = $buff[$ii+1]; } } } if ($allowMultipleBindPoses || validateMultipleBindPoses()) { $cmd = "createSkinCluster \""+ $args + "\""; $res = eval($cmd); } return $res; }