How to access gltf/fbx animations in script

Godot Version

4.3.beta3

Question

I’ve been trying to use the ufbx converter in the latest builds for Godot 4, really been enjoying them, especially using it to get animations from Mixamo and importing them as animation files! However, the files are a little “messy”, basically they all have the same animation name from a different library. I want to make this a bit “nicer”, so I tried to create a new resource that extends animation library that finds each .fbx file in my project and, if it’s an animation library, adds the animation it contains and renames it.

However, I’m having an issue. I can’t load the fbx file in script, I get an error saying that no loader can be found. However, the fbx file still behaves like an animation library in other areas in the editor. I’ve done some experiments and I believe this is also the case for fbx files. I’ve done some research and have seen GLTF/FBXDocument and State but I don’t know if these can be used to get the animation data that I want, it feels like these are more for exporting files.

To sum up - Is there a way I can access the animations in an FBX/GLTF file in the script?

Thanks all!

1 Like