SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

SM Forums / Maya Questions / Programming / Adding a squash and stretch expression through mel

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
Thread Tools
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

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with squash and stretch mpaloski Animation 1 25-10-2013 01:25 AM
rigging character for squash & stretch animation lisa_ching Animation 8 05-09-2005 10:00 AM
Squash and stretch with Skele Gun-Kata Animation 2 16-05-2004 10:53 PM