// SCRIPT: setWorldTrans v1.0 // AUTHOR: Joey Miller - Technical Artist // CONTACT: millerlight13@gmail.com // WEB: www.willanimateforsnickerdoodles.com // // PREPARE OBJECTS TO BE INFLUENCE ONBJECTS // SO WEIGHTS WILL MIRROR LATER global proc setWorldTrans() { if ( `window -exists setWorldTrans` )deleteUI setWorldTrans; window -title "setWorldTrans" -s 0 -w 210 -h 122 setWorldTrans; columnLayout top; frameLayout -w 200 -h 63 -label "Info" -labelAlign "top" -borderStyle "in"; columnLayout; text -l "Select object and press button to"; text -l "reset translation to world coordinates"; text -l ""; setParent top; rowColumnLayout -numberOfColumns 1 -columnWidth 1 200; button -w 200 -h 30 -l " - setWorldTrans - " -c doSetWorldTrans; showWindow setWorldTrans; } global proc doSetWorldTrans() { string $sel[] = `ls -sl`; if (`size($sel)` > 0) { for ($current in $sel) { select -r $current; FreezeTransformations; float $objPos[] = `xform -q -a -ws -piv`; move -rpr 0 0 0; FreezeTransformations; xform -a -ws -t $objPos[0] $objPos[1] $objPos[2]; } } else error ("select one or more objects"); }