/*
* Advanced weighting script X
* Wraith - Game extraction tools
*/

global proc WraithMesh_4757ecee_00_BindFunc()
{
   select -r WraithMesh_4757ecee_00;
   select -add j_slide;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_00");

   skinPercent -tv j_slide 1.0 $clu WraithMesh_4757ecee_00.vtx[0:3158];
}

global proc WraithMesh_4757ecee_01_BindFunc()
{
   select -r WraithMesh_4757ecee_01;
   select -add tag_barrel_attach;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_01");

   skinPercent -tv tag_barrel_attach 1.0 $clu WraithMesh_4757ecee_01.vtx[0:2376];
}

global proc WraithMesh_4757ecee_02_BindFunc()
{
   select -r WraithMesh_4757ecee_02;
   select -add tag_sight_on2;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_02");

   skinPercent -tv tag_sight_on2 1.0 $clu WraithMesh_4757ecee_02.vtx[0:895];
}

global proc WraithMesh_4757ecee_03_BindFunc()
{
   select -r WraithMesh_4757ecee_03;
   select -add j_safety;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_03");

   skinPercent -tv j_safety 1.0 $clu WraithMesh_4757ecee_03.vtx[0:448];
}

global proc WraithMesh_4757ecee_04_BindFunc()
{
   select -r WraithMesh_4757ecee_04;
   select -add tag_sight_on;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_04");

   skinPercent -tv tag_sight_on 1.0 $clu WraithMesh_4757ecee_04.vtx[0:47];
}

global proc WraithMesh_4757ecee_05_BindFunc()
{
   select -r WraithMesh_4757ecee_05;
   select -add j_slide;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_4757ecee_05");

   skinPercent -tv j_slide 1.0 $clu WraithMesh_4757ecee_05.vtx[0:3];
}

global proc RunAdvancedScript()
{
   catch(WraithMesh_4757ecee_00_BindFunc());
   catch(WraithMesh_4757ecee_01_BindFunc());
   catch(WraithMesh_4757ecee_02_BindFunc());
   catch(WraithMesh_4757ecee_03_BindFunc());
   catch(WraithMesh_4757ecee_04_BindFunc());
   catch(WraithMesh_4757ecee_05_BindFunc());
}

global proc NamespacePurge()
{
   string $allNodes[] = `ls`;
   for($node in $allNodes) {
      string $buffer[];
      tokenize $node ":" $buffer;
      string $newName = $buffer[size($buffer)-1];
       catchQuiet(`rename $node $newName`);
   }
}

print("Currently binding the current model, please wait...\n");
NamespacePurge();
RunAdvancedScript();
print("The model has been binded.\n");

