Stretching IK Leg

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  03 March 2018
Stretching IK Leg

Hi everyone, i'm working on a rig following the tutorial Creating a Comprehensive Character Rig from Maya Learning Channel. I made the left IK leg rig perfect, is stretching, but I'm doing the right leg and when i used the same Mel script, it doesn't work, I think maybe is because the Translation X in the left is positive and in the right is negative, I need help with that.

This is the script:

string $driver = "dist_l_length_IK0Shape1.distance";
float $leftThighLength = `getAttr jDrv_l_knee_IK01.translateX`;
float $leftKneeLength = `getAttr jDrv_l_ankle_IK01.translateX`;
float $sumLength = $leftThighLength + $leftKneeLength;
setDrivenKeyframe -currentDriver $driver -driverValue $sumLength -attribute "translateX" -value $leftThighLength jDrv_l_knee_IK01;
setDrivenKeyframe -currentDriver $driver -driverValue ($sumLength*2) -attribute "translateX" -value ($leftThighLength*2) jDrv_l_knee_IK01;
setDrivenKeyframe -currentDriver $driver -driverValue $sumLength -attribute "translateX" -value $leftKneeLength jDrv_l_ankle_IK01;
setDrivenKeyframe -currentDriver $driver -driverValue ($sumLength*2) -attribute "translateX" -value ($leftKneeLength*2) jDrv_l_ankle_IK01;

That's for left Leg, of course I substitute the left for the right and the "l" for the "r".
The answaer me an tell me that I need to multiply the various stretch equations by -1, but muy question is where exactly in the equation i have to multiply by -1.
Hope you can help me.
 
  04 April 2018
The distance will always be positive so you don't need to multiply the driverValue, instead multiply the value by -1.
__________________
LinkedIn | Website | Vimeo | YouTube | Twitter | Facebook
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:28 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.