Workflow for exporting of animated 3D character from blender to Godot #4680
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Yeah, unfortunately keyframing the deforming bones did not fix the issue. Pausing the animations inside Godot still results in the thin forearm (but that doesn't mean that much since it holds the value of the bones last played I believe). Something else I tried that did not improve things is cleaning up vertex groups (removing low influence vertex groups for each vertex). I believe glTF export only exports 4 vertex groups at most per vertex (not sure how it selects which ones to export, but I suspect it chooses the highest influencing ones). Choosing to export with all bone influence under skinning will result in the mesh not showing up in Godot by the way: Also a note is that if you have non-deforming vertex groups such as Smoothing, or Physics, you should normalize all weights with the deforming subset only, as otherwise it will include those groups that don't correspond to deforming bones. Good news is that there is a new pull request for the glTF exporter for separating the export of deforming only bones away from exporting animations: KhronosGroup/glTF-Blender-IO#1668 |
Beta Was this translation helpful? Give feedback.
-
There are numerous issues with exporting an animated character from Blender to Godot (3.4.4.stable) and I'd like to document the problems, my current workarounds, and possible improvements.
First off what I have in Blender (3.2):
What I need to export:
I first tried exporting the mesh and rig together through glTF with animations enabled. There are two major problems with this:
Removing the drivers presumably allows these tracks to be removed, however the drivers are needed for ease of posing. One possibility is duplicating the blend file, removing all the drivers, then exporting; however this needs to be done every time I need to export and is not viable.
I then tried deleting the NLA tracks prior to export, then undo to recover the animations. However, this did not work because the empty tracks from the drivers still caused an AnimationPlayer object to be instantiated on the exported .gltf.
After this, I looked into options of exporting the meshes without animations at all; however, the option to export only deforming bones is only available if the animation is checked in the export menu:
I now export the meshes independently with non-deforming bones, then export just the rig with animations and only deforming bones. Importing both of these into Godot, I then transfer the MeshInstances from the Skeleton(s) with non-deforming bones over to the Skeleton with only deforming bones, as well as adding that Skeleton's parent node to the scene tree:
Where this code is attached to the
player
scene, which is directly linked from the active game sceneWhile thing seem to work so far, the loading is very slow and I am getting errors because I am transferring skin binds that have non-deforming bones to a skeleton that has only deforming bones, leading to hundreds of errors:
How can I improve this situation, such as by improving the load speed, making the export process easier, or removing the errors? Is it much easier to just do all the animations in Godot? Even after the grueling 10+ hours experimenting with exporting the animation, it is still incorrect (forearm is too thin for whatever reason):
Beta Was this translation helpful? Give feedback.
All reactions