So, I have a character I'm exporting to md5 for an iPhone game. The entire mesh is FK except for the legs, which are IK. All the animations look correct in max. However, some of the animations don't make it to the md5 in tact. In some of the animations:
standing
attacking
getting hit
The legs don't move. It's as if the IK chains failed in those instances. Which is weird because in:
running
sprinting
blocking
The legs move fine.
I looked into the curve editor and found that in the broken animations, the FK bones were keyed at zero even though the IK was clearly moving them in the viewport. In the working animations, the FK bones are keyed as if they had been animated with FK rather than IK (though they were animated using IK.)
So my hypothesis is that the md5 format doesn't read the IK chains. It only reads the keys directly on the bones.
My question is why haven't the bones been keyed like they have in other animation segments? Attached picture is of the curve editor displaying the IK chain for the left leg and the left thigh bone as comparison.
Replies
You should probably setup your file with an extra skeleton that follows the existing bones and generates the keys based off that.
Or you could use biped or CAT for your skeletons which would make converting the IK to keys easy.
@Buzzy Unfortunately since the bones are already at zero, the dummy keys do nothing.
FK: rotation only.
IK: err.. your IK set up, typically this is never exported these bones are ignored or the FK bones are snapped/blended to its position. Its like a helper rig that never gets keyed.
Resulting Bones: Some rigs in order to blend between FK/IK they have a 3rd skeleton that everything is skinned to and contains the final keys, its only this rig that gets exported and it typically contains FK keys only.
Biped is about the only system that tries really hard not to keep it all on one system and do a lot of behinds the scenes math using Quaternion values instead of Euler curves. In the past working Quaternion only was a bitch, but they've included a translate/switch feature that lets you work in Eular but the behinds the scenes stuff is quaternion, pretty nice. there are few rigs that do it as cleanly as biped most are a cluttered nightmare that are easy to break. Naught Dog put in a mother f-ton of work to develop a 3 rig system that works like biped but for Maya, its never been released but it took a small army of tech artists... most people say screw that, and just deal with bipeds quirks.
You can force it work like other rigs by having another object that the IK links to, and you can snap/blend to it like other rigs if you really want to, but most of the time that isn't necessary, you just grab the hand, move it around, then rotate the same piece.
CAT is more like a traditional rig with regard to IK/FK blending and all of the headaches and advantages of that system. I find loading and saving poses and motion into a biped is a lot easier and mostly stick to biped unless I need to do a multi armed creature, a dragon or some other non-standard animal.
The Tooltip should say Set Key
See, the curve editor shows no bone movement, but they are clearly moving in the viewport (because they are following the IK goals). So, simply keying the value (no movement, in my case) doesn't help. I need to generate new values based on their local orientations.
This method is kind of primitive but it might do the job.
One thing i'm confused on is what do you need the keys for? Im just not sure how exactly that tool export your animation?
That is just crazy enough to work. I had never considered it because I didn't know you could save out envelopes. This new knowledge also helped with a different conundrum. Beautiful!
I need the keys on the bones because I'm exporting to MD5 (Doom 3 format), and the character's legs won't move in game. It's like IK doesn't make the conversion at all. I hope the dummy controllers don't suffer the same fate, or this idea won't make it very far...
*SIGH* The envelope transfer failed. Looks like I will have to do it manually.
When messing with the skinning you always have to make sure that the bones where added into the modifier when its in its t-pose(best practice i would say is set keys at t-pose -20 frames from your first frame your animation starts. that way you can return to it if changes are needed.)
In addition i would go ahead and do the point helper method on all the bones you are skinning so you can have one just for export. If its gonna be a lot of repetitious work i could always help. I know my maxScript.
But for a start i would go ahead and see if the messed up results actually export correctly before you make anymore effort to fixing the skinning.
Thanks!