global proc shelf_Skinning () { global string $gBuffStr; global string $gBuffStr0; global string $gBuffStr1; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "create set" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "Set" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//------------------Weight Set---------------------\r\n// \tcreated by: Michael Paixao\r\n//\tinfo@simpletofind.ca\r\n//\tCreates a Set and names it after the bone\r\n//\r\n//\tselect the vertices, or objects with weight\r\n//\tselect the joint last\r\n//\r\n//\thit Zee button!!!\r\n//-------------------------------------------------\r\n\r\nglobal proc weightSet()\r\n\r\n{\r\n\r\n// Finds the skinCluster\r\n\r\n$set = `ls -sl`;\r\n$cluster = `listConnections -type skinCluster`;\r\n//print $cluster[0];\r\n\r\n\r\n$Sel = `ls -sl`;\r\nstring $selectAndList[] = $Sel;\r\nstring $SetName;\r\n$objList = `size $selectAndList`;\r\n$lastSelect = $selectAndList[$objList-1];\r\n\r\n\r\nsets -n ($lastSelect + \"Set \");\r\n\r\nskinPercent -tv $lastSelect 1 $cluster[0] $Sel;\r\n\r\n}\r\n\r\nweightSet;" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "select intersection" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "Sel" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//------------------Weight Intersection ------------\r\n// \t\r\n//\tinfo@simpletofind.ca\r\n//\t\r\n//\r\n//\tselect 2 or more sets\r\n//\tbutton away!!\r\n//\r\n//\t\r\n//-------------------------------------------------\r\n\r\n{\r\n// checks if you have selected 2 sets\r\n// I use the { } brackets to keep all the variables local to\r\n// to the procedure\r\n\t{\r\n\t$sel = `ls -sl -typ \"objectSet\"`;\r\n\tif (`size $sel` <= 1)\r\n\t{\r\n\t// if this error call is used, the script stops here\r\n\terror \"select two or more sets\";\r\n\t}\r\n\t}\r\n\t\r\n//find boundary\r\n\t\r\n\t$sets = `ls -sl -typ \"objectSet\"`;\r\n\tstring $allBound[];\r\n\tstring $allJoint[];\r\n\tstring $joint[]; \r\n\tfor ($set in $sets)\r\n\t{\r\n\t$memberSelection = `sets -q $set`;\r\n\tselect -r $memberSelection;\r\n\t$vertex = `ls -sl -type \"float3\"`;\r\n\t$joint = `ls -sl -type \"joint\"`;\r\n\t\r\n\tSelectPolygonSelectionBoundary $vertex;\r\n\t$boundary = `ls -sl`;\r\n\t$size =`size $boundary`;$size2 =`size $joint`;\r\n\tappendStringArray ($allBound, $boundary, $size);\r\n\tappendStringArray ($allJoint, $joint, $size2);\r\n\t \r\n\t}\r\n\t\r\n//remove non neightbord boundary\r\n\t\t\r\n\t$memberSelection = `sets -q $sets`;\r\n\tselect -r $memberSelection;\r\n\t$vtx = `ls -sl -type float3`;\r\n\tSelectPolygonSelectionBoundary $vtx;\r\n\t$nonBoundary =`ls -sl`;\r\n\t\r\n\t//select -r $allBound $allJoint ;\r\n\tselect -r $allBound;\r\n\tselect -d $nonBoundary;\r\n// if there are no vertices left...\r\n\t{\r\n\t$vtxCheck = `ls -sl -type float3`;\r\n\tif (`size $vtxCheck` == 0)\r\n\t{\r\n\twarning \"no vertex in the sets\";\r\n\t}\r\n\t}\r\n}" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -annotation "Paint Skin Weights Tool: Paint weights on smooth bound skins" -align "center" -label "Paint Skin Weights Tool" -labelOffset 0 -font "tinyBoldLabelFont" -image "paintSkinWeights.xpm" -image1 "paintSkinWeights.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "ArtPaintSkinWeightsTool" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -annotation "Paint Selection Tool: Paint selection of cvs/vertices/faces/edges" -align "center" -label "Paint Selection Tool" -labelOffset 0 -font "tinyBoldLabelFont" -image "artSelect.xpm" -image1 "artSelect.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "// I made this too!... not... does anyone actually read these?\r\nArtPaintSelectTool" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "smoothSelection;" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "hldOn" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//\r\n//\tcreated by: Mike Paixao\r\n//\tsimpletofind.ca\r\n//\r\n//\r\n//\tselect joints you want to weight between\r\n//\thit this button, locks the rest of the joints\r\n\r\nglobal proc smoothSelection()\r\n\r\n{\r\n$selected = `ls -sl`;\r\n$cluster = `listConnections -type skinCluster`;\r\nfor ($clust in $cluster)\r\n{\r\n$allJoint = `listConnections -t joint $clust`;\r\n$allJointMS = `ls -sl -typ joint`;\r\n//print $allJointMS;\r\n//print $allJoint;\r\n\r\n\tfor ($weights in $allJoint)\r\n\t{\r\n\t $holdMe = ($weights+\".liw\");\r\n\t //print $holdMe;\r\n\t setAttr $holdMe 1;\r\n\t}\r\n\r\n\tfor ($weights in $allJointMS)\r\n\t{\r\n\t $holdMe = ($weights+\".liw\");\r\n\t //print $holdMe;\r\n\t setAttr $holdMe 0;\r\n\t}\t\r\n}\r\n}\r\nsmoothSelection;" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "smoothSelection Off" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "hOff" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//\r\n//\tcreated by: Mike Paixao\r\n//\tsimpletofind.ca\r\n//\r\n//\r\n//\tused to dissable the locked weights, just select any joint and run the button\r\n\r\nglobal proc smoothSelectionOff()\r\n\r\n{\r\n$selected = `ls -sl`;\r\n$cluster = `listConnections -type skinCluster`;\r\nfor ($clust in $cluster )\r\n{\r\n$allJoint = `listConnections -t joint $clust`;\r\n$allJointMS = `ls -sl -typ joint`;\r\n//print $allJointMS;\r\n//print $allJoint;\r\n\r\n\tfor ($weights in $allJoint)\r\n\t{\r\n\t $holdMe = ($weights+\".liw\");\r\n\t //print $holdMe;\r\n\t setAttr $holdMe 0;\r\n\t}\r\n\r\n\tfor ($weights in $allJointMS)\r\n\t{\r\n\t $holdMe = ($weights+\".liw\");\r\n\t //print $holdMe;\r\n\t setAttr $holdMe 0;\r\n\t}\t\r\n\r\n}\r\n}\r\n\r\nsmoothSelectionOff;" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "sets vertex's weight to 100%" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "w100" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//\r\n//\tcreated by Michael Paixao\r\n//\twww.simpletofind.ca\r\n//\r\n//\tselect the vertices.. or edges etc...\r\n//\tselect the joint last (or obj that is an influence) last\r\n//\twill weight your selection to w\"X\" amount\r\n\r\n{\r\nint $token;\r\nstring $buffer[];\r\nstring $set[];\t\r\nstring $allClusters[];\r\nstring $cluster;\r\n\t\r\n$set = `ls -sl`;\r\n\r\nif (`size $set` <= 1 )\r\n\terror \"please select vertex's followed by the joint to weight them to\";\r\n\r\n$allClusters = `ls -type skinCluster`;\r\n\r\n$token = `tokenize $set[0] \".\" $buffer`;\r\n\r\nfor ($skinCluster in $allClusters)\r\n\t{\r\n\t\t$clustCon = `listConnections $skinCluster`;\r\n\t\tfor ($obj in $clustCon)\r\n\t\t\t{\r\n\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t}\r\n\t\tif (`size $cluster` == 0 )\r\n\t\t\t{\r\n\t\t\t$clustCon = `listConnections ($skinCluster+\"Set\")`;\r\n\t\t\t\tfor ($obj in $clustCon)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t}\r\n\r\nif (`size $cluster` == 0 )\r\n\terror \"selection does not have a skin cluster\";\r\n\r\n$Sel = `ls -sl`;\r\nstring $selectAndList[] = $Sel;\r\nstring $SetName;\r\n$objList = `size $selectAndList`;\r\n$lastSelect = $selectAndList[$objList-1];\r\n\r\nprint (\"Weighted Selection to \" + $lastSelect);\r\n\r\nskinPercent -tv $lastSelect 1 $cluster $Sel;\r\n\r\n}" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "sets vertex's weight to 50%" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "w50" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//\r\n//\tcreated by Michael Paixao\r\n//\twww.simpletofind.ca\r\n//\r\n//\tselect the vertices.. or edges etc...\r\n//\tselect the joint last (or obj that is an influence) last\r\n//\twill weight your selection to w\"X\" amount\r\n\r\n{\r\nint $token;\r\nstring $buffer[];\r\nstring $set[];\t\r\nstring $allClusters[];\r\nstring $cluster;\r\n\t\r\n$set = `ls -sl`;\r\n\r\nif (`size $set` <= 1 )\r\n\terror \"please select vertex's followed by the joint to weight them to\";\r\n\r\n$allClusters = `ls -type skinCluster`;\r\n\r\n$token = `tokenize $set[0] \".\" $buffer`;\r\n\r\nfor ($skinCluster in $allClusters)\r\n\t{\r\n\t\t$clustCon = `listConnections $skinCluster`;\r\n\t\tfor ($obj in $clustCon)\r\n\t\t\t{\r\n\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t}\r\n\t\tif (`size $cluster` == 0 )\r\n\t\t\t{\r\n\t\t\t$clustCon = `listConnections ($skinCluster+\"Set\")`;\r\n\t\t\t\tfor ($obj in $clustCon)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t}\r\n\r\nif (`size $cluster` == 0 )\r\n\terror \"selection does not have a skin cluster\";\r\n\r\n$Sel = `ls -sl`;\r\nstring $selectAndList[] = $Sel;\r\nstring $SetName;\r\n$objList = `size $selectAndList`;\r\n$lastSelect = $selectAndList[$objList-1];\r\n\r\nprint (\"Weighted Selection to \" + $lastSelect);\r\n\r\nskinPercent -tv $lastSelect 0.50 $cluster $Sel;\r\n\r\n}" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "sets vertex's weight to 20%" -labelOffset 0 -font "tinyBoldLabelFont" -imageOverlayLabel "w20" -image "commandButton.xpm" -image1 "commandButton.xpm" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//\r\n//\tcreated by Michael Paixao\r\n//\twww.simpletofind.ca\r\n//\r\n//\tselect the vertices.. or edges etc...\r\n//\tselect the joint last (or obj that is an influence) last\r\n//\twill weight your selection to w\"X\" amount\r\n\r\n{\r\nint $token;\r\nstring $buffer[];\r\nstring $set[];\t\r\nstring $allClusters[];\r\nstring $cluster;\r\n\t\r\n$set = `ls -sl`;\r\n\r\nif (`size $set` <= 1 )\r\n\terror \"please select vertex's followed by the joint to weight them to\";\r\n\r\n$allClusters = `ls -type skinCluster`;\r\n\r\n$token = `tokenize $set[0] \".\" $buffer`;\r\n\r\nfor ($skinCluster in $allClusters)\r\n\t{\r\n\t\t$clustCon = `listConnections $skinCluster`;\r\n\t\tfor ($obj in $clustCon)\r\n\t\t\t{\r\n\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t}\r\n\t\tif (`size $cluster` == 0 )\r\n\t\t\t{\r\n\t\t\t$clustCon = `listConnections ($skinCluster+\"Set\")`;\r\n\t\t\t\tfor ($obj in $clustCon)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif ( $obj == $buffer[0] )\r\n\t\t\t\t\t\t$cluster = $skinCluster;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t}\r\n\r\nif (`size $cluster` == 0 )\r\n\terror \"selection does not have a skin cluster\";\r\n\r\n$Sel = `ls -sl`;\r\nstring $selectAndList[] = $Sel;\r\nstring $SetName;\r\n$objList = `size $selectAndList`;\r\n$lastSelect = $selectAndList[$objList-1];\r\n\r\nprint (\"Weighted Selection to \" + $lastSelect);\r\n\r\nskinPercent -tv $lastSelect 0.20 $cluster $Sel;\r\n\r\n}" -sourceType "mel" -actionIsSubstitute 0 -commandRepeatable 1 ; }