setAttr("pCube1.tx", getAttr("pCube1.tx") * -1); setAttr("pCube1.ry", getAttr("pCube1.ry") * -1);
// list whatever the user has selected string $mySel[] = `ls -selection`;
string $foot1 = $mySel[0]; string $foot2 = $mySel[1];
int $frame = `currentTime -q`;
setAttr("cn_Hand_L.tx", getAttr("cn_Hand_R.tx") * -1); setAttr("cn_Hand_L.ty", getAttr("cn_Hand_R.ty") ); setAttr("cn_Hand_L.tz", getAttr("cn_Hand_R.tz") ); setAttr("cn_Hand_L.rx", getAttr("cn_Hand_R.rx") ); setAttr("cn_Hand_L.ry", getAttr("cn_Hand_R.ry") * -1); setAttr("cn_Hand_L.rz", getAttr("cn_Hand_R.rz") * -1);
// get the active selection string $sel[] = `ls -sl`; string $nameTokenBuffer[]; // split the name of the first selected object by "_". L/R (should) be the last entry. int $numTokens = tokenize($sel[0], "_", $nameTokenBuffer); // extract the last entry. string $selectedSide = $nameTokenBuffer[$numTokens - 1]; string $mirroredSize = ""; // set the side of the opposite control. L->R / R->L if (tolower($selectedSide) == "l") $mirroredSide = "R"; else if (tolower($selectedSide) == "r") $mirroredSide = "L"; else error("Unknown side \"" + $selectedSide + "\""); // build the name of the opposite control using the mirrored side, and modify the values of its xform setAttr("cn_Hand_" + $mirroredSide + ".tx", getAttr("cn_Hand_" + $selectedSide + ".tx") * -1); setAttr("cn_Hand_" + $mirroredSide + ".ry", getAttr("cn_Hand_" + $selectedSide + ".ry") * -1); setAttr("cn_Hand_" + $mirroredSide + ".rz", getAttr("cn_Hand_" + $selectedSide + ".rz") * -1);