// EJL_copyPivot // 9-3-08 // last item selected with be the source. All previously selected will get that pivot info. proc EJL_copyPivot() { string $sel[] = `ls -sl`; int $size = `size($sel)`; if ($size <= 1) { error "EJL Says: Must select at least two objects (child, then parent)\n"; } // determine parent int $masternumber = ($size - 1); string $master = $sel[$masternumber]; // get parent's pivot information vector $sPivot = `xform -q -ws -rp $master`; float $pivot[] = $sPivot; // change pivot of each child to parent's pivot for ($x in $sel) { xform -ws -rp $pivot[0] $pivot[1] $pivot[2] $x; xform -ws -sp $pivot[0] $pivot[1] $pivot[2] $x; } // feedback print (" EJL Says: I changed the pivot on " + $masternumber + " object(s) to match the pivot of " + $master + ".\n"); // end proc } EJL_copyPivot;