global proc storePointWeights() { global float $sourceWeights[]; string $sourcePoints[] = `ls -sl -fl`; string $sourcePoint = $sourcePoints[0]; string $sourceParts[]; tokenize $sourcePoint "[]" $sourceParts; int $intSourcePoint = $sourceParts[1]; //Find the skinClusters string $skinList[]; $skinList = `listHistory $sourcePoint`; $skinList = `ls -type skinCluster $skinList`; string $sourceSkin = $skinList[0]; string $allJoints[] = `skinCluster -q -wi $sourceSkin`; /* int $jointCount = `size($allJoints)`; //float $sourceWeights[]; for($k=0; $k < $jointCount; $k++) { $sourceWeights[$k] = `getAttr($sourceSkin + ".weightList[" + $intSourcePoint + "].w[" + $k + "]")`; }//end for: copyWeights */ string $everyJoint[] = `ls -type joint`; int $everyJointCount = `size($everyJoint)`; for($k=0; $k < $everyJointCount; $k++) { $sourceWeights[$k] = `getAttr($sourceSkin + ".weightList[" + $intSourcePoint + "].w[" + $k + "]")`; }//end for print $sourceWeights; }//end proc global proc pastePointWeights() { global float $sourceWeights[]; string $destPoints[] = `ls -sl -fl`; //Find the skinClusters string $skinList[]; $skinList = `listHistory $destPoints[0]`; $skinList = `ls -type skinCluster $skinList`; string $sourceSkin = $skinList[0]; string $allJoints[] = `skinCluster -q -wi $sourceSkin`; int $jointCount = `size($allJoints)`; int $oldNormWeights = `getAttr ($sourceSkin + ".normalizeWeights")`; setAttr ($sourceSkin + ".normalizeWeights") 0; for($thisPoint in $destPoints) { string $destParts[]; tokenize $thisPoint "[]" $destParts; int $intDestPoint = $destParts[1]; /*for($k=0; $k < $jointCount; $k++) { setAttr($sourceSkin + ".weightList[" + $intDestPoint + "].w[" + $k + "]") $sourceWeights[$k]; }//end for: pasteWeights */ string $everyJoint[] = `ls -type joint`; int $everyJointCount = `size($everyJoint)`; for($k=0; $k < $everyJointCount; $k++) { setAttr($sourceSkin + ".weightList[" + $intDestPoint + "].w[" + $k + "]") $sourceWeights[$k]; }//end for }//end for setAttr ($sourceSkin + ".normalizeWeights") $oldNormWeights; //skinPercent -normalize true $sourceSkin $destObj; }//end proc global proc jpCopyPointWeights() { string $winName = "jpCopyPointWeights"; if (`window -exists $winName`) deleteUI $winName; window -t "Copy Point Weights" //-wh 100 35 -rtf 1 $winName ; rowColumnLayout -nr 2 -rh 1 25 -rh 2 25 ; button -w 100 -l "Store" -c ("storePointWeights()"); button -w 100 -l "Paste" -c ("pastePointWeights()"); showWindow $winName; }