When I import a 3d armature into defold and try to animate it the animated sections of the model distort very bad, nothing like they are set to in blender. I have tried several test models and ones with a few bones worked ok, but trying to play a rigged human type armature doesn’t work.
It seems like it could be an issue with the keyframe settings, whenever I lock them in I use LocRotScale, or LocRot.
can anyone steer me in the right direction here? I have been using blender for a few years but am by no means great with it. If anyone has an example of the workflow from blender that would be great.
There are some limitations in what Defold supports for 3D models/Collada files:
only one mesh per Collada file.
only one root bone (if I remember correctly).
animations should be “prebaked” and animation keys should be described as matrices. (a bit technical, but this is usually the case if bake the action in Blender)
Would you mind sharing the Blender file (and Collada export) so I could take a look?
Well I may have figured out some of the problem as I got a simple walk animation to work finally. First exporting in Collada the pose the model is in at export should be the resting pose. Besides having to check “apply modifiers” all the export settings are on default. Secondly it also looks like the in order to keep the bones from deforming during animation you need to clear the mesh rotation and location using ALT-R and ALT-G in object mode. There is probably a better way to do this, it would be nice to be able to rest the feet on the grid, but this is what worked for me.
What exactly is “prebaking” the animations? Mine are just keyframes in a dopesheet that were locked in using the LocRot setting. I’m not sure if it’s just a fluke that I got it to work as I have tried many different test models in many different ways.
I’m attaching the blender file and collada for you, as the functionality maybe hanging on by a string here since I hacked my way through it.example.zip (175.8 KB)
I think I may have figured out how to solve the location and rotation issue so you can keep the feet of the model at 0. Before you export you have to apply location and rotation by going to object mode and Control-A and select rotation, and then again Control-A and selection location. Do this for both the armature and the mesh.
Also when exporting if you are using any control bones make sure to select “deform only” in the export settings.
I cleaned up the examples mesh and added some IK bones to the legs and re-animated it with it’s feet at 0. It seems to be still working, but let me know if there is anything I’m missing or that would help this be more stable.