So
To say I'm having trouble getting this into the game
correctly would be an understatement, this is one crazy bird.
There is nothing wrong the blender file per se, the export script just expects things to be in a certain way, and if they aren't, all kinds of weirdness happens.
Problem one: The hierarchy of the model is not what the script expects.
We need a game_matrix node, RootNode and a local_srt, also in this model the mesh is parented to the rig, in all the LoG2 animated models I have seen the mesh is parented to the local_srt node. After setting up the hierarchy the model exports but I got the same error you got when trying it in game or with the GMT.
Problem two: The model has custom shapes for some of the bones, very handy for animating the crow, but I don't know how the script reacts to it, so I changed the bones to standard again. The model DIDN'T export, I got a new error
that pointed towards tangent space errors for the faces.
Problem three: The model has a mix of triangles and quads (tangent space error), the script wasn't handling it. This was an easy fix with the blender build in command to triangulate the faces. The model exports but AGAIN the same "D3DERR_INVALIDCALL" as from start.
Problem four: The bones have active modifiers on them (copy rotation, constrains etc). None of the model from the asset pack have them, and they are really not needed once you have baked the animation. So I removed all the modifiers from the bones. That massed up the animation, the crow was turkey on crack, time to take a step back.
Problem five: before removing the modifiers I went over the hierarchy of the bones, the feet have IK (don't know how the script reacts to IK). So I removed the IK from feet and exported, the animation was still on crack and the feet are now inside the bird. Since I removed IK I needed to go over bone parenting for the feet, I did and fixed the feet.
Problem six: When going over the bone hierarchy I saw that sometimes the rotation method for a bone, changed between "XYZ Euler" and "Quaternion WXYZ". So I fired up some models with animations from the asset pack, all bones always have "Quaternion WXYZ" so I changed all the bones of the bird to that. The model exported, but crashed the game, and GMT went into an endless loop that I had to kill from process explorer to get my computer back
lets get back to basics.
Lets remove all animation data from the rig, lets remove all the modifiers from the bones and every and all transformation or constrain, lets reset everything to rest pose.
Can I export the model with a rig enabled with no animation, YES, model is fine inside the GMT and the game.
Can I animate the rig myself with a few keyframes and export that animation, YES , but it warps, ok we have a weight issue.
Problem seven: Many game engine have a limit to how many weights can be assigned to vertices, industry standard is 4.
What if I tell blender to limit bone weight to vertices to 4 (console tells my I have affected around 103 vertices !!!!!!)
Model exports and test animation does not deform the mesh, but still something is strange !!.
Problem eight: Can a vertex have the total weight assigned to it, a higher value then one ?, never seen that in any of the models from the asset pack, so lets normalize all the weights to one.
Everything exports, but still the animation is a little off.
So at this point I think lets, copy the poses from the original file into every frame of the clean rig, so I have the correct animation and see how that looks. NO, everything crashes, both the game and GMT
what the effing hell is going on, I just copied the poses from the the original file, this should have worked, but didn't.
Ok, back to clean rig without animation, this is just 25 frames, I can do this by hand having two instances of blender open and simply manually setting every frame like the original file.
Everything exports, but the animation is off
The top position extends way behind the blender animation and the lowest wing position doesn't go nearly as low as in the blender animation.
The rig has no constrains, there are no modifiers on the rig, the animation is baked, why is this happening ?, why am I doing this on a Friday ?, why I'm I not drunk somewhere ? (because of social distancing dude) ..... right, lets continue then
.
Skuggasveinn.