View Full Version : How to Make Stretchy Limbs?

09 September 2004, 07:00 PM
Hey guys ,

I am building a simple character for animation , its basicly a ball with two legs. I want to be able to have his legs stretchy and also be able to turn on\off that function (keyable)

You can see the example at ( , the ball character in the quicktime promo vid.

Anyone done something similar before? or any pointers? , I know this'll involve expressions which I know nothing about :)

Thanks in advance!

09 September 2004, 08:35 PM
Hi. Not sure if this will, but other at Mike Malinowski's site there's a goku rig that has stretchy limbs, spine etc..

Hope this helps.. :D

09 September 2004, 10:03 PM
Put an expression in bone length ctrl_dist(root.kine.,eff.kine.) where root and eff is root and effector of the chain. Ingnore cycling warning.
If you want to switch it on and off create custom parameter and condition in the expression which checks out for the state of this parameter.
This is a dirty way of doing it, there are better methods.

09 September 2004, 10:11 PM
This is what I came up for the on and off.

cond( torus.bone_crap.stretch_on == 1 , ctr_dist( , ) , 5)

The torus has a custom parameter set called "bone_crap" and a parameter called stretch_on. If its on you have stretchy bone, if off it goes back to the original length of 5.

09 September 2004, 11:01 PM
ok It just messes up the chain when I do that. is there anyway t9o get this to work on a 2bone chain or am I missing something?

09 September 2004, 10:08 AM
if effector is constrained to control object cube :
where length is bone's length at rest position
where length1 is bone1's length at rest position
( replace values in expression )

expression for bone.length

cond( ctr_dist( root., cube. ) > length+length1, length + ( ctr_dist( root., cube. ) - length+length1 ) / 2, length )

expression for bone1.length

cond( ctr_dist( root., cube. ) > length+length1, length1 + ( ctr_dist( root., cube. ) - length+length1 ) / 2, length1 )

to switch it on and off, you just have to add another control.
I suggest you draw a new one-bone chain. parent root1 to root. set Bone2's length value to length+length1 then position constrain eff1 to cube.
create a null, position constrain it to eff1 ( second chain's effector ) then position constrain it to cube. And use the second constraint's blend weight to control how much stretching you want.
you, of course, have to replace cube. by null. in the bones'expressions.

09 September 2004, 01:07 AM
Thanks lorex , i'll try that out!

09 September 2004, 07:42 AM
Lorex I did what you wrote and it works , although I have this problem:

When I move the control cube nothing happens at first than it suddenly starts working and I get this weird snap effect.

Can you also tell me whats going on with your expression and what its doing , When I use this for bone 1 (ball is the model name and cube is the ctrl obj) :

cond( ctr_dist( , ) >2.3 , ctr_dist( , ) , 2.3)

I get a cycle independency created and it acts weird. Your dont get a cycle independency though I dont know why.

Thanks in advance man ,

09 September 2004, 08:25 AM
basically when the leg is fully extended the distance from chain root to cube is equal to the sum of the bones' lengths. When you pull cube away, you get a gap between the chain's effector and the cube. The expression will calculate is gap ( that's the distance between the root and the cube minus the bones' lengths ) and divide it in half then add this value to both bone lengths to fill the gap.

expression checks if there's a "gap" between effector and cube

cond( ctr_dist( root., cube. ) > length+length1,

if cond is true, expression adds half the "gap" to the bone's length

length + ( ctr_dist( root., cube. ) - length+length1 ) / 2,

if cond is false, bone's length remains unchanged

length )

From what I see, you've got bone1 in your expression and that will screw the expression ( you'll get a cycle dependency ). Use root instead of first bone. And also the "true" part of your expression is wrong.

Hope that helps.

CGTalk Moderation
01 January 2006, 04:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.