How to prevent legs from bending backwards? Ugh!

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
RigTheory
Posts: 23
Joined: Sat Aug 13, 2022 2:00 pm

How to prevent legs from bending backwards? Ugh!

Post by RigTheory »

Hi again! I'm working on a rig that will be the template for a bunch of characters. I'm working on a 'recipe' so I'm obsessing over a few details. You probably saw from my other posts that I've been having a "fun" time with some of the issues. I'm having a love/hate relationship with target bones. One one hand, I don't like them because I can't manipulate a character's legs directly from the thigh or legs bones. But, on the other hand, it's sweet to be able to use target bones to create an invisible floor and have the character bend her knees when the hips are moved downward. Ya can't have it all, I guess :P

Image

Is there a way to prevent legs from bending backwards? It's funny that as soon as I settled on using target bones, every other time I bend the legs they go backwards. :cry:
If it's not moving it's probably dead. WE NEED ANIMATION!
____________________
Explainer Videos: www.kinetictext.com/
Animation Tutorials: www.youtube.com/c/RigTheory
User avatar
slowtiger
Posts: 6081
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by slowtiger »

Didn't you use bone restraints at the knees?
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
synthsin75
Posts: 9975
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by synthsin75 »

This usually happens when the bones are created in a straight line, without any bend at the knee. To fix it, just try rotating the shin bone until it bends to the other side, and cut/paste that shin bone rotation to frame one. This pre-bends the knee, so Moho knows which way you intend it to bend when you move the target bone.
User avatar
RigTheory
Posts: 23
Joined: Sat Aug 13, 2022 2:00 pm

Re: How to prevent legs from bending backwards? Ugh!

Post by RigTheory »

@synthsin75 right on! seems like the best answer is the simplest one. I'll try it :)
@slowTiger- what is a restraint? is this the same as a constraint? :D
If it's not moving it's probably dead. WE NEED ANIMATION!
____________________
Explainer Videos: www.kinetictext.com/
Animation Tutorials: www.youtube.com/c/RigTheory
User avatar
slowtiger
Posts: 6081
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by slowtiger »

Constraints, of course.
(Too many different programs. Stuff named differently each time.)
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by SimplSam »

You can also try using the Move Targeted Joint plugin script, which can help to get target using bones out of a jam: https://mohoscripts.com/script/mr_move_targeted_joint
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by Greenlaw »

Anytime you use IK, it helps to have a slight 'pre-bend' in the joint. This tells Moho what the preferred direction for the bend is. The bend can be very slight so the artwork does not need to reflect the bend. (BTW, using a pre-bend is normal for any program using IK, including 3D animation programs.)

If you're using a target bone for the foot and you need to make the knee joint bend in the opposite direction, you will need to force a new pre-bend by holding down Alt and scrubbing horizontally on the targeting bone (i.e., the lower leg bone in this case.) The direction depends on the direction of the pre-bend...you'll figure it out after you've played with this a bit. With a little practice, it's easy to make this direction switch animate smoothly. (I do this all the time in Moho.)

Hope this helps, and good luck!
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by SimplSam »

Greenlaw wrote: Sun Nov 13, 2022 9:35 pm ...
If you're using a target bone for the foot and you need to make the knee joint bend in the opposite direction, you will need to force a new pre-bend by holding down Alt and scrubbing horizontally on the targeting bone (i.e., the lower leg bone in this case.) The direction depends on the direction of the pre-bend...you'll figure it out after you've played with this a bit. With a little practice, it's easy to make this direction switch animate smoothly. (I do this all the time in Moho.)
...
What tool are you on when you are scrubbing? Is that Transform - which will Translate the bone ??
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by Greenlaw »

Oh, sorry: I'm normally using Manipulate Bones when I'm animating characters with IK. Using Manipulate Bones with the Alt pressed switches it to FK mode. This is useful for rotating any bone in the chain independent of IK. For example, to rotate the foot bone when it has Independent Angle applied, or to tweak the position of any of the arm bones without using IK. Releasing Alt switches back to IK mode.
Matzilla
Posts: 11
Joined: Mon Feb 13, 2023 4:27 pm

Re: How to prevent legs from bending backwards? Ugh!

Post by Matzilla »

I have been having the same problem and this fixed it. Not sure I understand how yet. But thanks!
m
m
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by Greenlaw »

Matzilla wrote: Wed Oct 04, 2023 3:22 pm Not sure I understand how yet. But thanks!
Here's a visual demo...

Image

On the left side, I have a leg with a straight line of bones. Without the pre-bend, Moho doesn't know which way to bend the leg, so it guesses. Half the time, it guesses incorrectly. You can influence the direction by rotating the lower leg bone and setting a keyframe for the preferred direction.

On the right side, I have a slight pre-bend in the leg. This lets Moho know which way the leg should bend by default. Just like in the above example, I can change the direction in an animation frame by rotating the lower bone to the new preferred direction.

That 'pop' can be smoothed by scaling the leg a little shorter or raising the root bone during the direction change. Alternatively, I may use IK Stretching to automatically handle the scaling for me. (This is often the best choice.)

Hope this helps.
Last edited by Greenlaw on Wed Oct 04, 2023 4:13 pm, edited 2 times in total.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by Greenlaw »

Additional tip: It might seem like you have to rotate the lower limb in the opposite direction of the bend direction you want, but you're actually posing it correctly into that pre-bend pose.

It may feel wrong but it's right. :D
Matzilla
Posts: 11
Joined: Mon Feb 13, 2023 4:27 pm

Re: How to prevent legs from bending backwards? Ugh!

Post by Matzilla »

Thanks for this!
But if you are trying to do a 180° body turn, don't you need the knee to bend both ways?
Or am i missing something?
m
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: How to prevent legs from bending backwards? Ugh!

Post by Greenlaw »

Yes, the technique lets you do that. Keyframe the bend during animation as described, and IK will follow the new direction.

That's what's happening in both versions of the rig above: The 'pre-bend' in the right side example sets the initial direction, but the direction can be changed anytime, as shown in the left side example. I'm changing the directional angle in the knee joint when I 'wipe' across the lower limb, which automatically creates a keyframe in the joint. The keyframe tells IK to bend the knee in the new direction.

This keyframe may introduce a 'pop' in the knee, but you can smooth it by keyframing the length of the leg bone during the turn. You can do this manually during animation, or you can plan for it to work automatically using a Squash and Stretch constraint. If you do the latter, leave the Squash and Stretch set to 100% and increase the Maximum to whatever is appropriate for your character. (150% works fine for many cartoon-style characters; use a lower vault for more realistic ones.)
Post Reply