Etape 8
Sélectionner toutes les feuilles et utiliser le script pour renommer les feuilles et pour replacer le pivot de chaque feuille au bon endroit
int $pivot = 0;
//---------------------------rename the leaves---------------------------------
string $selection;
string $list[] =`ls -sl`;
int $i,$size = size($list);
for ($i=0; $i < $size; ++$i)
{
$command = "rename " + $list[$i] + " leaf_" + $i; eval $command;
}
//------------------------------select leaves-------------------------------------
$i=0;
$selection = "";
while ($i < $size)
{
$selection = $selection + "leaf_" + $i+" "; $i++;
}
$command = "select -r " + $selection; eval $command;
//------------------------------translate pivot------------------------------------
string $liste[] = `ls -sl`;
float $place_pivot[3];
for ($i=0; $i < $size; ++$i)
{
// -----------------------save position in an array----------------------------
$command = "$place_pivot = `xform -q -ws -t " + $liste[$i] + ".pnts[" + $pivot + "]`"; eval $command;
//------------------------move pivot------------------------------------------------
$command = "move " + $place_pivot[0] + " " + $place_pivot[1] + " " + $place_pivot[2] + " " + $liste[$i] + ".scalePivot " + $liste[$i] + ".rotatePivot" ; eval $command;
}