0 votes

So I'm working on a 3D project.
After exporting a gun model with glTF 2.0 format, I try to import it to Godot. Everything is good until I check the animations list and find out that there are some missing animations. Other animations work fine.
Thanks in advance.

asked Nov 14, 2019 in Engine by congbinh75 (55 points)
retagged Nov 14, 2019 by congbinh75

1 Answer

+3 votes
Best answer

glTF exporting is sort of messy business right now, which is somewhat unfortunate because it's the only format that actually seems to fully work. There's a number of things I've done to ensure it works properly:

  1. If you're not using it already, install Blender 2.81. I don't believe the glTF exporter works properly with older versions.
  2. Delete the glTF addon folder from blender's install directory (eg. "C:\Program Files\Blender Foundation\blender-2.81\2.81\scripts\addons\ioscenegltf2\") and replace it with the current version from github. (you can just take out the "ioscenegltf2" folder under addons and ignore the other files)
  3. Ensure your rig has no 'floating bones' without a parent, except for the root bone. It seems the ChildOf constraint is unsupported and using it will cause export to fail. Drivers driven by Custom Properties also do not seem to be supported and will cause export failure, so try to accommodate that.
  4. Create a 'null' animation with all of the actor's bones in the default state (you can easily achieve this by enabling 'Auto Keying' and pressing Ctrl+G, Ctrl+R, Ctrl+S in succession. Select this as the current action for the armature each time before you export.
  5. Ensure your model's mesh(es) are parented to their armature.
  6. Ensure all the animations you want to export are in seperate NLA tracks. Because the glTF exporter exports animations individually (rather than as one long sequence, which is then divided into strips by the game engine like FBX), it doesn't matter if they overlap.
  7. Select your meshes and armature objects and export as .glTF with the following export options:
    Remember export settings: Yes
    Selected Objects: Yes
    Transform +Y-Up: Yes
    =Use current frame: No
    =Animation: Yes
    ==Limit to playback range: No
    ==Always sample animations: Yes
    ==NLA strips: Yes
    ==Export deformation bones only: Yes

In Godot, I highly recommend setting the Animation Storage option to "Files (.anim)". This way, you can export single animations from blender at a time, as needed, without having to export the entire animation library every time you adjust or add an animation- which will speed up your export and import time considerably.

answered Nov 15, 2019 by thirite (154 points)
selected Nov 15, 2019 by congbinh75

Wow, really thank you! I didn't follow every step but when I checked NLA tracks as you said in step 6 and found that isn't every animations has its own NLA track. I seperated them by "Stash" button in Action Editor and then imported the model to Godot. Finally all of its show up and work fine. Thank you again.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.