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

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

   skinPercent -tv tag_stock_attach 1.0 $clu WraithMesh_05065d8e_00.vtx[0:759];
}

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

   skinPercent -tv tag_stock_attach 1.0 $clu WraithMesh_05065d8e_01.vtx[0:314];
}

global proc RunAdvancedScript()
{
   catch(WraithMesh_05065d8e_00_BindFunc());
   catch(WraithMesh_05065d8e_01_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");

