sheefy
05-22-2006, 09:27 AM
...once it's stretched to its defined limit. Basically I want to stretch a leg to a point and then freeze the stretchyness so that I can still bend the knees afterwards and walk on really long legs.
I'm using the basic stretchy legs script (thanks to whoever wrote it - sorry I don't know who did) where it stretches once the IK chain completely extends. Have a look at the following code;
dependsOn $IKC_L_Ankle $B_L_Hip $CNTRL_Foot;
--Get Values from Custom Attributes
freezeStretch = $CNTRL_Foot.modifiers[#Attribute_Holder].Custom_Attributes[#Freeze_Stretch].value
allowedStretch = $CNTRL_Foot.modifiers[#Attribute_Holder].Custom_Attributes[#Stretch_Amount].value
--Calculate Length
d = distance $IKC_L_Ankle.pos $B_L_UpperLeg.pos;
leng = $B_L_UpperLeg.length + $B_L_LowerLeg.length
stretch = (d - leng);
orig = $B_L_UpperLeg.length
if (stretch > allowedStretch) then stretch = allowedStretch;
if (stretch < 0) then stretch = 0;
stretchP = orig + (stretch/2);
--Stretch/Freeze Length
--if freezeStretch == true then <freeze length/position here, how?> else sp = stretchP
I've got two custom attributes (these are on the foot spline if you download the file) - one that defines the limit and the other is a boolean button which when pressed will freeze the stretch so that I can use the long legs. I was trying to put it in that last line (don't ask how) but couldn't get it to work (obviously).
Would this be the proper method to go about doing this? If not, how could I achieve this effect?
Any help would be greatly appreciated and just incase you wanted to have a look at the file I have attached it. I'm very new to Maxscript and rigging so sorry for my ignorance on this matter.
I'm using the basic stretchy legs script (thanks to whoever wrote it - sorry I don't know who did) where it stretches once the IK chain completely extends. Have a look at the following code;
dependsOn $IKC_L_Ankle $B_L_Hip $CNTRL_Foot;
--Get Values from Custom Attributes
freezeStretch = $CNTRL_Foot.modifiers[#Attribute_Holder].Custom_Attributes[#Freeze_Stretch].value
allowedStretch = $CNTRL_Foot.modifiers[#Attribute_Holder].Custom_Attributes[#Stretch_Amount].value
--Calculate Length
d = distance $IKC_L_Ankle.pos $B_L_UpperLeg.pos;
leng = $B_L_UpperLeg.length + $B_L_LowerLeg.length
stretch = (d - leng);
orig = $B_L_UpperLeg.length
if (stretch > allowedStretch) then stretch = allowedStretch;
if (stretch < 0) then stretch = 0;
stretchP = orig + (stretch/2);
--Stretch/Freeze Length
--if freezeStretch == true then <freeze length/position here, how?> else sp = stretchP
I've got two custom attributes (these are on the foot spline if you download the file) - one that defines the limit and the other is a boolean button which when pressed will freeze the stretch so that I can use the long legs. I was trying to put it in that last line (don't ask how) but couldn't get it to work (obviously).
Would this be the proper method to go about doing this? If not, how could I achieve this effect?
Any help would be greatly appreciated and just incase you wanted to have a look at the file I have attached it. I'm very new to Maxscript and rigging so sorry for my ignorance on this matter.
