I’m having an issue getting the correct animation in Blender to work in Unity. To explain succinctly, I’ve been testing a “snake” animation that uses a Spline IK constraint on the armature to get the proper bending/slithering, etc. The problem is, the Unity animation doesn’t properly play (does sort of a see-saw animation as if there’s only one bone in the armature instead of an undulating snake).
So, how do I get animations that have an armature - which is dependent on modifiers and constraints - in Blender to carry over properly into Unity? What does baking do (I tried several different “bakes” on the armature/mesh/spline and still the same result)? What do I need to do if I’m using FBX for all of this?
I’ve looked in several places and it seems like tutorials either ignore or gloss over things like this (or I might not be looking hard enough).
Usual issues: Have you applied rotation and scale to your character so that it is scale 1 and rotation 0/0/0? Is your rig correct? Maybe vital parts are not proper weightpainted. And note that you can only export bones animations. No vertex animation / shapekeys. Is your interpolation mode correct? Do you maybe need more keyframes? Have you tried to record ALL keys for a keyframe (whole character)? How do you export ? When by FBX, have you ticked selection only? When yes, is there by chance another bone system in the scene? Blender grabs all animation available in the scene and exports it with the selection then. No matter if the animation is really part of the selected armature or not.
Most of those are things I’ve tried. I’m curious, does selecting ONLY the mesh bring over the armature also? It sounds like it from your explanation.
But back to the issue - it seems like my problem is baking those key-frames generated by the constraints/IK Spline onto the bones. For some reason, I cannot find anyway to do that.
I have empty objects that control how the spline moves (which is constrained to the armature bones). How do I translate the information from the keyed constraints/empties onto the bones?
Well, unfortunately that didn’t work. For some reason the animation goes into Unity as one solid bone. So, instead of the mesh undulating with the bones (about 5 on the test armature) like it does in Blender, the mesh just rocks back and forth like a rigid plank of wood in Unity. I don’t understand why it’s not taking the baked key-frames on the bones.
The first link is my attempt at constraining bones to curves and empties. The second link is the result of following the tutorial link mentioned by bls.
Dantus is correct. You are using bone envelopes instead of vertex weights to bind the vertices to the bones. The easiest way to fix it is to select the mesh object, then shift select the armature and hit Ctrl-P, then choose Armature Deform->With Envelope Weights or With Automatic Weights.