Home Technical Talk

3ds max 2010: Why are my IK chains not keying bone rotation?

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.

fk_ik_problem.jpg?w=35f94bf3

Replies

  • PocoElMono
    Options
    Offline / Send Message
    I should add that in the case of the standing animation, the IK chain goals do not move, as the feet are planted on the ground. However, the root moves up and down, bending the legs. Yet this does not translate to the bone rotation. :(
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Ik chains in 3d studio max are real time solutions. So you are correct in assuming that they'll never generate bone rotation keys. That's just what IK does.

    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
    Options
    Offline / Send Message
    The easiest thing would be to just add keyframes to the bones. Select the bones and press 'k' to add a keyframe. Because its controlled by IK, this will essentially just be a dummy keyframe that doesnt effect the animation but will still export. Or course, I've never used the md5 exporter so i don't know for sure.
  • PocoElMono
    Options
    Offline / Send Message
    @sprunghunt: Thanks for the suggestions. I will look into them!

    @Buzzy Unfortunately since the bones are already at zero, the dummy keys do nothing. :(
  • Mark Dygert
    Options
    Offline / Send Message
    Yea typically you have 2-3 skeletons when you're working with IK and there is some kind of blending set up.

    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.
  • PocoElMono
    Options
    Offline / Send Message
    I appreciate all the help guys, but I'm afraid I need to bring this thread back from the dead. I would make a second skeleton, but I don't understand how you have something "generate keys." How do you accomplish this?
  • SpeCter
    Options
    Offline / Send Message
    SpeCter polycounter lvl 14
    Hit the big Key button in max(It´s a big button with a Key on it)
    The Tooltip should say Set Key
  • PocoElMono
    Options
    Offline / Send Message
    Thank you SpeCter, but that is not what can help me. The key button simply creates a key frame from the current values. What I need is to generate NEW values based on the bone's rotation.

    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.
  • FortyOne
    Options
    Offline / Send Message
    You could always just add a couple of Point helpers and throw an orientation constraint and a position constraint on them to have them follow the actual rig so that you have two systems in place(one for export and one for animation). Skinning should be easy to fix if you just save out the envelopes and re apply them to the new helpers. That way you can have one system that can have its own link hierarchy which will never interfere with you animation rig.

    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?
  • PocoElMono
    Options
    Offline / Send Message
    @FortyOne

    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...
  • PocoElMono
    Options
    Offline / Send Message
    @FortyOne

    *SIGH* The envelope transfer failed. Looks like I will have to do it manually.
  • PocoElMono
    Options
    Offline / Send Message
    Here is a picture of what happens when I skin the right shin to the new rightShin_HELP object. Even with a position and orientation constraint, it is clear that the object is not following the bone correctly.

    helper_constraint.jpg?w=c7cfb2a3
  • FortyOne
    Options
    Offline / Send Message
    hmm did you mess with the envelopes mid animation or add the bone to the modifier mid animation or did you do it when it was in its t-pose.

    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.
  • Mark Dygert
    Options
    Offline / Send Message
    To transfer skin weights from one mesh to another, apply skin wrap to the newer mesh, target the old mesh, tweak the settings and convert to skin. The align one skeleton to another was what I was talking about in my first post. IK/FK snapping is really common in most rigs.
  • PocoElMono
    Options
    Offline / Send Message
    I will try that next, Vig. Sorry I didn't really understand your first post. Now I realize you were listing the three skeletons and their functions.

    Thanks!
Sign In or Register to comment.