Page 1 of 1

How to prevent legs from bending backwards? Ugh!

Posted: Sat Nov 12, 2022 3:02 pm
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:

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

Posted: Sat Nov 12, 2022 5:55 pm
by slowtiger
Didn't you use bone restraints at the knees?

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

Posted: Sat Nov 12, 2022 7:22 pm
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.

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

Posted: Sat Nov 12, 2022 9:09 pm
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

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

Posted: Sat Nov 12, 2022 9:55 pm
by slowtiger
Constraints, of course.
(Too many different programs. Stuff named differently each time.)

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

Posted: Sat Nov 12, 2022 11:39 pm
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

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

Posted: Sun Nov 13, 2022 9:35 pm
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!

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

Posted: Sun Nov 13, 2022 11:18 pm
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 ??

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

Posted: Sun Nov 13, 2022 11:53 pm
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.

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

Posted: Wed Oct 04, 2023 3:22 pm
by Matzilla
I have been having the same problem and this fixed it. Not sure I understand how yet. But thanks!
m

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

Posted: Wed Oct 04, 2023 4:00 pm
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.

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

Posted: Wed Oct 04, 2023 4:10 pm
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

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

Posted: Tue Nov 07, 2023 9:27 am
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?

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

Posted: Tue Nov 07, 2023 11:20 am
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.)