I have been trying to import a model from mixamo with an animation into Panda3d but every time i run the animation the model becomes distorted and looks nightmarish. I have tried loading the model as a glb, gltf, obj and even bam file. The animation works well in blender but looks aweful when i use it in my game please i would like to know what I am doing wrong.
This is the model naturally when the animation doesn’t play:
I encountered something similar when I was making my animation exporter for blender. There, it was an issue of all parts of a model needing to have the same origin as the top-level bone of the skeleton.
In blender, the origin of the skeleton should be the same as that of any mesh it displaces, since panda3d assumes that is the case.
In blender, the origin is represented by a little orange dot that appears whenever an object is selected.
If your problem is what I believe it to be, you should be able to fix this in object mode by selecting the skeleton, pressing shift+s, “cursor to selected”, and then selecting the geometry, and then from shift+s selecting “origin to 3d cursor”.
Please note this is off the top of my head, and I might have misremembered a step of the process.
https://youtu.be/Z158bGot1S4?si=xlYS5sL_1GsLuX_S I tried following this tutorial and I’m not too sure of what I’m doing wrong, I’m guessing it’s maybe due to an update in mixamo, blender or Panda3d.
If you consider that the viewer is built into Windows OS, displays the model in gltf format normally. Then it has something to do with panda.
A similar distortion can be achieved in a blender by simply scaling the mesh, then as LifeLand pointed out, there is some kind of scale dependence here.
I tested YABEE from Maxwell175. This method also works, but the pbr pipeline is lost.
I have previously successfully used the format .x for animation, but over time there was instability in playback, I will need to check it again somehow.
blend2bam depends on – and uses – panda3d-gltf. You can see which version you have with pip list. You can update the panda3d-gltf dependency with pip install -U panda3d-gltf.
The panda3d-gltf → 1.0.1 update fixes this issue. However, it looks like the newly installed blend2bam package does not capture the new version of panda3d-gltf during installation.