Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Adding a squash and stretch expression through mel (https://simplymaya.com/forum/showthread.php?t=41123)

thebooface 27-12-2014 04:15 PM

Adding a squash and stretch expression through mel
 
Hi everyone,
I'm currently trying to finish off a rigging tool I've developed, and the last step to do so is adding an expression for squash and stretch on the spine.

I can't for the life of me figure out how to do so through MEL, however. This is the expression I'm trying to add:

Code:

$scale = curveInfo1.arcLength/($arcLength * root_anim.globalScale);
$sqrt = 1/sqrt($scale);

ik_spine_joint.scaleX = $scale;
ik_spine_joint.scaleY = $sqrt;
ik_spine_joint.scaleZ = $sqrt;

ik_spine_1_joint.scaleX = $scale;
ik_spine_1_joint.scaleY = $sqrt;
ik_spine_1_joint.scaleZ = $sqrt;

ik_spine_2_joint.scaleX = $scale;
ik_spine_2_joint.scaleY = $sqrt;
ik_spine_2_joint.scaleZ = $sqrt;

ik_spine_3_joint.scaleX = $scale;
ik_spine_3_joint.scaleY = $sqrt;
ik_spine_3_joint.scaleZ = $sqrt;

ik_spine_4_joint.scaleX = $scale;
ik_spine_4_joint.scaleY = $sqrt;
ik_spine_4_joint.scaleZ = $sqrt;

ik_spine_5_joint.scaleX = $scale;
ik_spine_5_joint.scaleY = $sqrt;
ik_spine_5_joint.scaleZ = $sqrt;


If anyone could guide me, it'd be greatly appreciated.


All times are GMT. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018