View Single Post
27-12-2014, 04:15 PM   #1
Registered User
Join Date: Mar 2014
Posts: 6
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:

$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.
  Reply with quote