// =========================================================================== // 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. // =========================================================================== proc templateSkinShape(string $skinCluster, int $state) { string $geoms[] = `skinCluster -q -g $skinCluster`; for ($geom in $geoms) { toggle -state $state -template $geom; } } global proc moveJointsMode(int $newState) { string $sel[] = `ls -sl`; int $count = 0; if ($newState == 0) { string $skinClusters[] = `ls -type skinCluster`; for ($sc in $skinClusters) { skinCluster -e -moveJointsMode 0 $sc; templateSkinShape($sc,0); $count++; } if ($count > 0) { print( (uiRes("m_moveJointsMode.kSkinningEnabled"))); } } else { for ($obj in $sel) { string $skinClusters[]; if ("joint" == nodeType($obj)) { $skinClusters = `listConnections -type skinCluster $obj`; } else { string $relClust = findRelatedSkinCluster($obj); if (size($relClust) > 0) { $skinClusters[0] = $relClust; } } if (size($skinClusters) == 0) { $skinClusters = `ls -type skinCluster`; } for ($sc in $skinClusters) { skinCluster -e -moveJointsMode $newState $sc; templateSkinShape($sc,1); $count++; } if ($count > 0) { print( (uiRes("m_moveJointsMode.kSkinningDisabled"))); } } } if (0 == $count) { warning( (uiRes("m_moveJointsMode.kNoSkinsFound"))); } }