Godot Version
4.4.1 stable
Question
Hey all, I’m having issues with animations not playing as intended in godot after exporting from blender. essentially part of my mesh is staying stationary when it should be moving.
I’m not very proficient with blender but this morning after trouble shooting, i re-jiggered the skeleton in hopes of solving the issue. it plays as intended inside of blender but when imported to godot the head/mouth does not move or behave like it’s attached to the bones/armature.
I have 3 animations, attack, death, and move. the head is detached in all 3 after exporting.
I’ve tried applying all transforms, that didn’t seem to do anything. I also tried re-parenting the head to the body. it plays in blender still but still not correctly in godot.
Any ideas on what else I can try? like i said I don’t really know blender that well so any suggestions are appreciated.
Blender takes a bit of manual tweaking to export rigged meshes over GLTF.
Check for the following settings when you are exporting your model:
- With the model and the skeleton selected, check “include”->“limit to”->“selected objects”
- Data->Shape Keys
- Data->Armature->Use Rest Position Armature
- Animation->Animation mode set to “Actions” or “NLA Tracks”. If you choose NLA tracks, make sure to add one track with one strip for each animation and name the tracks properly.
- If you activate Animation sampling (bake each animation into fixed FPS bone transform keyframes) then you should also enable Data->Armature->Export deformation bones only.
When exporting humanoids sometimes i had old animations ending up on new slots like “walk_002, throw_002” while the old “walk, throw” names ended up with garbage data. Not sure if it’s a bug or i messed up my blend files, but something like that might have happened to you too.
i also forgot to mention, modifiers don’t carry over from blender to GLTF. Make sure you set:
Data->Mesh->Apply Modifiers,
on export.
I updated my export settings how you reccomended so i think that helped a bit. I tried a rexport and the issue persisted. I noticed in godot that my head mesh was showing outside of the bone heirchy, so i tried reoparenting it again but this time not to the body, but to a child of the body in the collection and now it’s working in godot.
It should have been a child of the skeleton as they were linked when animating. but im not sure whats going on. Switching animation mode to NLA was super helpful, the file size is 1/3rd of what the exports were previously.
Updated blender and godot node trees.
I was using File/Export in Blender but an option I have only recently stumbled upon is to save the export settings at the Collection level, this way if you need to re-export it’s much easier to be comfortable that you have the same setup. The panel also allows you to save presets so once you find something that works for you, you can repeat the process on other files/collections.
File/Export obviously still works, but I find it easier to use this Collection route on files that have multiple collections that I want to individually export.
Oh that’s good to know it’s an option. I probably messed up my scene heiarchy as I had two collections with different parts assigned. Would you mind sharing your collection heiarchy so I can see how you do it with these export settings?
No rush
Here’s my Blender file:-
I’m making two different size aircraft hangars but the sliding door and the door gantry rail are common so I’ve ended up with four collections for those items and another collection with lights and camera etc. so I can do test renders.
Here’s the Godot end:-
Each Godot hangar scene has one of the hangar.glb files, one of the gantry.glb and 6 instances of a door scene. The door scene uses the door.glb and has a script to open or closer by following a Path3D.
I tried making the different parts in separate Blender files and saving those files directly into the Godot file locations but my thought processes simply find it easier to build related objects in a remote Blender file and then publish the individual part.glb files to Godot. I intend to make other buildings that follow the same logic - a main structure with a set of doors that either slide or swing or up-and-over etc. and this file structure fits my needs.
If you haven’t watched it I recommend this video from the recent Godot conference. The speaker gives examples of how she used Blender and Godot to make a workflow that suited her project.
https://www.youtube.com/watch?v=5fDuf2IlizU
As with all these things there is no single best answer, I hope some of this proves to be useful.