Thursday, March 10, 2011

Joint-bending reloaded

Update 2011.04.24:
Joint-bending has now been disabled. In view of the previous update, it does not serve any purpose anymore, and it causes some problems. The option is still available in the mhx importer, but it does not do anything for newly exported mhx files.

Update 2011.03.19:
In case anybody has worried about the joint-bending, you can now forget about it. I fixed the problem by moving the knee joint instead.

Let me explain the problem and the solution. For most targets, the knee joint is located in front of the line between the hip and the ankle. When we turn on IK and move the foot up, the leg bends forward as is should.


However, the leg in the MakeHuman mesh is quite straight, i.e. the knee diamond is located very close to the hip-ankle line. If the knee diamond happens to be at the other side of the line, the leg will bend in the wrong direction. Note that this problem only occurs with IK; the FK leg still bends correctly.


Even if I have not encountered any character which behaves as badly as in the figure above, the diamond is translated in the X direction for some targets, which makes the knee bend inwards or outwards, like the child below. Joint-bending addressed this problem, but I think that the new solution is both simpler and better. Now the knee joint is not placed exactly in the diamond, but rather 1 cm in front of the hip-ankle line. The difference is neglible in the cases I have checked, but the IK legs now always bend in the right way.



Original post:
Some time ago I wrote about changing the rest pose for better IK. In Blender, it is best if the character is modelled with knees and elbows slightly bent, to tell the IK solver about the preferred bending axes. However, the improvement is minor for the default adult character that I'm doing most of my testing with. The bending option has therefore remained unused for quite a while, while the code deteriorated.

Recently scottfredeman pointed out a problem with toe twisting, which appears for short characters. When examining the child (default settings except for the age slider), I realized that his knees were bending around the wrong axis. Here we see the same pose (Root bone moved down) for the child, imported without and with the Bend joints option checked, respectively. Even if the pose to the right is not perfect, it is a considerable improvement compared to the left one.

To use Bend Joints, the mhx importer must be updated, due to an API change. The updated importer is in MH svn and tomorrow's nightly build. It is also in Blender svn, and will hence appear automatically in future Blender builds.


In some comments to the above-mentioned post, which I missed at the time, Illin points out that bending joints is not necessary in Maya, because the preferred bending axis can be specified anyway. That's great for the Maya folks, but I am not aware of anything similar for Blender. If there is, I would like to know.

1 comments:

  1. Great work. I've found in my work with rigging Makehuman that the most problematic joint is not the knee, but the hip, because the greater number of vertices to deal with, and the need for anatomical correctness. Mostly it requires locating the top of the femur lower than it is in an actual human skeleton. I used a karate roundhouse kick, and a pirouette to test it, because those moves require both hip flexion and rotation.

    ReplyDelete

© MHteam 2001-2010