Hi Crashers!
Im trying to write a simple script that checks to see what transform tool youre on (Move, Rotate, Scale) and zero out the channels for that specific tool.
So far I`ve been able to get all the channels to zero out, but getting the specific transforms to zero out seems to be eluding me.
Please forgive my MEL noobness, Im not that experienced with making scripts and seem to get by by frankensteining or mimicinng others scripts. Syntax is always a bit tricky for me to grasp.
Here`s the script I have so far:
string $whichCtx = `currentCtx`;
string $sel[] = `ls -sl`;
string $obj;
contextInfo -t $whichCtx;
for ($obj in $sel)
{
if ( $whichCtx == "Move Tool");
setAttr ($obj + ".translateX") 0;
setAttr ($obj + ".translateY") 0;
setAttr ($obj + ".translateZ") 0;
if ($whichCtx == "Rotate Tool");
setAttr ($obj + ".rotateX") 0;
setAttr ($obj + ".rotateY") 0;
setAttr ($obj + ".rotateZ") 0;
if ($whichCtx == "Scale Tool");
setAttr ($obj + ".scaleX") 1;
setAttr ($obj + ".scaleY") 1;
setAttr ($obj + ".scaleZ") 1;
};
I would appreciate any help on this.
Thanks!