I apologize if this is a common question. I’m rigging a human character and I’m following the Maya Learning Channel tutorials:
https://www.youtube.com/watch?v=iUPbO9-iEWs&list=PL8hZ6hQCGHMXKqaX9Og4Ow52jsU_Y5veH&index=13
This is the script I’m using to get my thigh and shin IK joints to stretch as I translate my foot control:
string $driver = “leftLeg_IK_lengthShape.distance”;
float $leftThighLength = getAttr (“leftShin_IK_JNT.translateX”);
float $leftShinLength = getAttr (“leftFoot_IK_JNT.translateX”);
float $sumLength = $leftThighLength + $leftShinLength;
setDrivenKeyframe -currentDriver $driver -driverValue $sumLength -attribute “translateX” -value $leftThighLength leftShin_IK_JNT;
setDrivenKeyframe -currentDriver $driver -driverValue ($sumLength2) -attribute “translateX” -value ($leftThighLength2) leftShin_IK_JNT;
setDrivenKeyframe -currentDriver $driver -driverValue $sumLength -attribute “translateX” -value $leftShinLength leftFoot_IK_JNT;
setDrivenKeyframe -currentDriver $driver -driverValue ($sumLength2) -attribute “translateX” -value ($leftShinLength2) leftFoot_IK_JNT;
When I execute these commands, my “knee” juts out (the thigh joint elongates) and it wont retain its shape. My joints are oriented as like the video, with no rotation or scale values. I have written this command with both tildas and with (" ") and have gotten the same result.
Trying to learn why this might happen and how to recognize it in the future. Thank you again for your help.