I came across this handy, simple and tiny MEL script for Matching the WorldSpace pivot of one object in Maya to another from FMP’s (Jim Dunford) Rigging Research site… Great for modeling and rigging… For more great Maya, MEL, Python scripting experiments, character rigs and other scripting resources, check out Jim Dunford’s site Rigging Research.

//Match Pivot by jim dunford 10/09/2011

string $object[] = `ls -sl`;

int $arraySize = `size $object`;
if ($arraySize < 2) print "only one object selected"; else { vector $e = `xform -q -rp -ws $object[0]`; setAttr($object[1]+ ".translateX") ($e.x); setAttr($object[1]+ ".translateY") ($e.y); setAttr($object[1]+ ".translateZ") ($e.z); print "great success!"; }

Like The Posts on LesterBanks?

Ensure You continue getting the most relevant tutorials, news, insights, and industry techniques by becoming a patron!