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

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

   skinPercent -tv tag_pistol_offset 1.0 $clu WraithMesh_f0a2ed7e_00.vtx[0:2910];
}

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

   skinPercent -tv tag_pistol_offset 1.0 $clu WraithMesh_f0a2ed7e_01.vtx[0:1695];
}

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

   skinPercent -tv j_hammer 1.0 $clu WraithMesh_f0a2ed7e_02.vtx[0:846];
}

global proc WraithMesh_f0a2ed7e_03_BindFunc()
{
   select -r WraithMesh_f0a2ed7e_03;
   select -add j_slidelock;
   select -add j_magrel;
   newSkinCluster "-toSelectedBones -mi 15 -omi true -dr 5.0 -rui false";   string $clu = findRelatedSkinCluster("WraithMesh_f0a2ed7e_03");

   skinPercent -tv j_slidelock 1.0 $clu WraithMesh_f0a2ed7e_03.vtx[198:497];
   skinPercent -tv j_magrel 1.0 $clu WraithMesh_f0a2ed7e_03.vtx[0:197];
}

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

   skinPercent -tv tag_trigger_hide 1.0 $clu WraithMesh_f0a2ed7e_04.vtx[0:183];
}

global proc RunAdvancedScript()
{
   catch(WraithMesh_f0a2ed7e_00_BindFunc());
   catch(WraithMesh_f0a2ed7e_01_BindFunc());
   catch(WraithMesh_f0a2ed7e_02_BindFunc());
   catch(WraithMesh_f0a2ed7e_03_BindFunc());
   catch(WraithMesh_f0a2ed7e_04_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");

