// enableJointMove.mel // v1.0 // September 3, 2000 // Soren 'kurgan' Jacobsen // kurgan@kurgan.dk (suggestions/bugreports welcome) // http://www.kurgan.dk/ // // Description: // Enables you to move the joint after skinning, using 'move-pivot'/ mode. // creates and parents 'skinOffsetNode' (a locator..) that makes it possible to // move the joints in 'movePivot' mode, without affecting the skin. // // Usage: // with the joints selected (not just the hierachy top!!) // it should ignore any selections except for joints. global proc enableJointMove() { string $selectedObjects[] = `ls -sl -type "joint"`; for( $current in $selectedObjects) { createPrimitive nullObject; setAttr .visibility 0; $currentLocatorList = `ls -sl`; $currentLocator=$currentLocatorList[0]; select -r $currentLocator $current; parent -r; $connectedBindPoseNodes=`listConnections -type "dagPose" -p on -d on $current`; $connectedSkinClusterNodes=`listConnections -type "skinCluster" -p on -d on $current`; $currentLocator = $currentLocator + ".worldMatrix[0]"; for( $currentConnection in $connectedBindPoseNodes) { if(`getAttr -type $currentConnection` == "matrix") { connectAttr -f $currentLocator $currentConnection; } } for( $currentConnection in $connectedSkinClusterNodes) { if(`getAttr -type $currentConnection` == "matrix") { connectAttr -f $currentLocator $currentConnection; } } } }