Hello, PigBelly
Small world, It's an old Dice colleague, Mattias Adolfsson
One other Dicer asked me the same thing and I made a rather ruff script for him. The whole solotion builds on that you have an original that's perfectly symmetrical.
Choose all blendshapes you want to mirror, then click on the original shape, no shift clicking, theres an undo in the script.
It's a rather ruff script and not much tested and rather slow. But try it
global proc vMirror()
{
//this script builds that you have an original mesh perfectly symmetrical
//choose all blend shapes that you want to mirror and then select the original,
// not shift click
//
string $selObjs[]=ls -sl
;
undo;
string $selObjChange[]=ls -sl
;
select $selObjs[0];
float $vertPos[];
int $pCounter=0;
int $nCounter=0;
string $posiVerts[];
string $negiVerts[];
PolySelectConvert 3;
string $vert_pairs[] =filterExpand -sm 31
;
int $vert_counts=size ($vert_pairs);
for ($i=0; $i < ($vert\_counts) ; ++$i)
{
float $vertPos[]=`xform -q -translation $vert\_pairs[$i]`;
//print $vertPos;
if ($vertPos[0]>0)
{
$posiVerts[$pCounter]=$vert\_pairs[$i];
++$pCounter;
}
if ($vertPos[0]<0)
{
$negiVerts[$nCounter]=$vert\_pairs[$i];
++$nCounter;
}
}
int $sVerts=0;
string $sortVerts[];
for ($i=0; $i < (size ($posiVerts)) ; ++$i)
{
float $vertPos[]=`xform -q -translation $posiVerts[$i]`;
for ($xi=0; $xi < (size ($negiVerts)) ; ++$xi)
{
float $vertPos2[]=`xform -q -translation $negiVerts[$xi]`;
if (($vertPos[0]==-$vertPos2[0]) && ($vertPos[1]==$vertPos2[1]) && ($vertPos[2]==$vertPos2[2]))
{
$sortVerts[$sVerts]=$posiVerts[$i];
++$sVerts;
$sortVerts[$sVerts]=$negiVerts[$xi];
++$sVerts;
break;
}
}
}
string $buffer[];
for ($qi=0; $qi < (size ($selObjChange)) ;++$qi)
{
for ($xi=0; $xi < (size ($sortVerts)))
{
tokenize $sortVerts[$xi] "." $buffer;
string $vselect=$selObjChange[$qi]+"."+$buffer[1];
float $vertPos[]=`xform -q -translation $vselect`;
++$xi;
tokenize $sortVerts[$xi] "." $buffer;
string $vselect=$selObjChange[$qi]+"."+$buffer[1];
string $cmd="xform -translation "+(-$vertPos[0])+" "+($vertPos[1])+" "+($vertPos[2])+" "+$vselect;
eval $cmd;
//print $cmd;
++$xi;
}
}
}
/Mattias O Adolfsson
/resident baldy at DICE Stockholm