Hello again,
In my hmdl-import-0.4 announcement, I mentioned that I used a hack to get the bones to work properly. I'm going to elaborate on that here. This is partly a warning to anyone who plans on using the bones as imported by 0.4, and partly a request for help in case anyone can easily identify the problem.
This is how bones work
without the hack that I mentioned:
(I also posted about this at
blenderartists.org, and it'll help to refer to those screenshots.) The Deform.83 bone's head/root is the shoulder joint, and its tail/tip is in the elbow joint. When I move the Deform.83 bone, the forearm, hand, and finger vertices move with it, but the upper arm vertices don't. The same thing happens all down the length of the arm: Moving the Deform.84 bone moves the hand and fingers but not the forearm, etc. One way of looking at it is that each vertex group seems to be associated with the parent of the bone it should be associated with.
At first, I thought this might mean I should just change the way the bones are created so that Deform.83 is instead called Deform.82, and so on. But there are two problems with this: First, what happens when a bone has more than one child, like when the wrist joint splits into 5 fingers? Which of the finger bones gets the Deform.84 name? What are the other ones called? And second, there doesn't seem to be enough data in the file for this. Imagine what would have to happen with the fingertips. If one of the old fingertip bones was called Deform.89 and ended at the first knuckle, there would have to be a new bone called Deform.89 that extended from that knuckle to the actual tip of the finger. But I can't find data that specifies the position of that new bone's tip.
There
is data that specifies the
rotation of that knuckle joint, though. If an object or bone were parented to the knuckle joint, then it would inherit that rotation. In fact, this is how the bits of armor are positioned and rotated. (So that's a third problem. The armor, for the most part, is positioned correctly right now. If we go and add an extra bone at the end of those anchor bones, it's going to push the pieces of armor away from the body.)
It's almost as if each "bone" specified in the model file is actually a joint. If I could create a tree of empties and use that instead of an armature, then there would be a shoulder empty called Deform.82, and when you rotated that empty, the arm mesh would move properly. The last joint in a finger (Deform.89 in the above example) would still be positioned at the first knuckle, but rotating that empty would bend the finger mesh at that knuckle.
But blender doesn't let you associate vertex groups with empties as far as I know, so I applied a hack instead: When I'm assigning the vertex groups to the meshes, I simply use the bone ID of the first child of the bone that I'm actually supposed to use. So the upper arm vertices are assigned to Deform.83 instead of Deform.82, and so on. The fingertip bones don't have children, though, so the vertices in the last finger segment have to be put into the same vertex group as the second-to-last finger segment, and the fingertips can't be articulated separately from the rest of the finger.
hmdl-import 0.4 incorporates this hack, which makes the bones mostly work properly, except for the fact that all the vertex groups at the tips of the hair, feet, and fingers are essentially lost because they've been merged with the next vertex group up the chain.
I don't know if this makes any sense or not, but I hope so. Anyway, if it's not clear, don't worry too much about it. I was just kind of hoping there might be an easy fix that someone with more rigging experience would instantly recognize. There might not be any such fix, or I might just be reading the bone data incorrectly.
Thanks,
--
gomtuu