12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- global proc reskinSelectedMeshes() {
- $influencers = `intSliderGrp -q -value myReskinInfluencers`;
- $selection = `ls -sl`;
- $selected = size($selection);
- if ($selected > 0) {
- $skinName = `textFieldGrp -q -text myReskinName`;
- if ($skinName != "") {
- $textField_exists = `objExists $skinName`;
- if ($textField_exists == 0) {
- waitCursor -state 1;
- $skinedCluster = $selection[0];
- $skinnedJoints = `skinCluster -q -inf $skinedCluster`;
- if ($selected > 1) {
- $duplicateObj = `duplicate $selection`;
- $createGrp = `group -n tempGroup`;
- $combine = `polyUnite -n $skinName $createGrp`;
- $deleteHistory = `delete -ch $combine`;
- delete $createGrp;
- } else {
- $duplicateObj = `duplicate -n $skinName $selection`;
- }
- $jnt = `select -add $skinnedJoints $skinName`;
- $selectionforBind = `ls -sl`;
- $newskin = `skinCluster -mi $influencers $selectionforBind`;
- $newSelect = `select -add $skinnedJoints $selection $skinName`;
- $transfer = `copySkinWeights -nm -sa "closestPoint" -ia "closestJoint"`;
- $cleared = `textFieldGrp -edit -text "" myReskinName`;
- $deleted = `delete $selection`;
- $deselect = `select -cl`;
- waitCursor -state 0;
- } else {
- error ("Skin name is already in use: " + $skinName);
- }
- } else {
- error "No name specified for re-skining.";
- }
- } else {
- error "No meshes selected for re-skining.";
- }
- }
- global proc babylonReskinTool() {
- string $window = `window -title "Reskin Geometry Tool"`;
- columnLayout -adjustableColumn true;
- textFieldGrp -label "New Skin Name" -text "" myReskinName;
- intSliderGrp -label "Max Influencers" -field true -minValue 1 -maxValue 8 -fieldMinValue 1 -fieldMaxValue 8 -value 4 myReskinInfluencers;
- button -label "Reskin Selected Meshes" -command "reskinSelectedMeshes()" myReskinButton;
- showWindow $window;
- }
|