# Ozz-Animation in Defold

**URL:** <https://forum.defold.com/t/ozz-animation-in-defold/78137>\
**Category:** Dev diaries\
**Created:** [September 18, 2024, 1:37pm UTC](https://forum.defold.com/t/ozz-animation-in-defold/78137 "2024-09-18T13:37:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlannan](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dlannan/32/39440_2.png) [@dlannan](https://forum.defold.com/u/dlannan)\
**Post date:** [September 18, 2024, 1:37pm UTC](https://forum.defold.com/t/ozz-animation-in-defold/78137/1 "2024-09-18T13:37:39Z")

</div>

I have been working on animations systems recently (in work and in my flix project) and I really wanted some runtime capability that is complicated in Defold atm (doable, but complicated).

I decided to look at Ozz Animation (since I had been doing this for my work) and see if I could integrate it into Defold as an extension. And viola!

Initial pass is done. It requires ozz animation files atm, but it will natively load gltf in a few days (maybe a week). The main features I need:

- runtime load/unload
- IK capabilities for feet on terrain and hands handling items
- Blendtrees for being able to configure a state machine to react to events and properties

Ozz Animation has much of this capability built-in, so I should be able to get these working fairly quickly.

Will update here and on Flix about the progress. Repo is here - all MIT.. use as youd like.  
[https://github.com/dlannan/defold-ozz-animation](https://github.com/dlannan/defold-ozz-animation)

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [September 18, 2024, 8:03pm UTC](https://forum.defold.com/t/ozz-animation-in-defold/78137/2 "2024-09-18T20:03:33Z")

</div>

Interesting! What tools can export ozz files?

---

<div class="post-metadata">

**Author:** ![dlannan](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dlannan/32/39440_2.png) [@dlannan](https://forum.defold.com/u/dlannan)\
**Post date:** [September 18, 2024, 10:09pm UTC](https://forum.defold.com/t/ozz-animation-in-defold/78137/3 "2024-09-18T22:09:06Z")

</div>

There are cli tools that should be in the repo ozz-animation/tools which does gltf to ozz (will add them if they arent there).  
Works the same as the fbx2ozz (which I will add as well):  
[https://guillaumeblanc.github.io/ozz-animation/documentation/toolset/](https://guillaumeblanc.github.io/ozz-animation/documentation/toolset/)  
Note: these are windows cli tools. I’ll add OSX and Linux too.

This is only interim though. I wanted to make sure I could actually apply the animation first 🙂  
The ozz format will disappear in the next few days and gltf/glb will be the main format.

Word of warning: I wouldnt use this in its current state for product. Theres a number of core issues that need resolving:

1. Performance. Like Defold its all CPU atm. The skinning will move to GPU and I will also move the animation and instancing there too. Want to have hundreds of anim obj in a scene 🙂
2. Structure/Org is _very_ rudimentary. It will evolve - I have some plans for caching and various other features, this is a very first step along this process.
3. Tools - currently I dont want people using cli tools, because its just a pain. So it is interim as well. Which I hope to have resolved first. I probably will keep ozz anim loading support (since the file sizes are quite small) but the intent is to have gltf as main loader. FBX _wont_ be supported natively. Its a horrible format with a SDK that is a pain, and its not worth the hassle.
4. Materials are fixed std model materials. This will change. I will support this always tho, since its a default form of Defold rendering.

I might also support a custom pipeline down the track too. Since ozz-lib has quite a good support for this.

---

<div class="post-metadata">

**Author:** ![dlannan](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dlannan/32/39440_2.png) [@dlannan](https://forum.defold.com/u/dlannan)\
**Post date:** [September 23, 2024, 2:47am UTC](https://forum.defold.com/t/ozz-animation-in-defold/78137/4 "2024-09-23T02:47:58Z")

</div>

Little update: Still working on this. Got side tracked and rebuilding my scripted geometry lib into a runtime gltf loader and geometry native extension. I need this, so the animation is faster to load and I can fetch directly from a gltf/glb.

I was going to do this in steps, now the gltf loader and anim loading will be built into one - seems to be more sensible 🙂 The gltf loader will be built \_without ozz anim in it, but it will build a go hierarchy (just like default Defold) that can be used at runtime (no skinning of course).

The defold-ozz-animation extension will be the gltf extension + all the ozz-animation extension together. People wanting to use models and objects themselves at runtime (load/unload etc) can basically just use the gltf plugin by itself.  
[https://github.com/dlannan/defold-gltf](https://github.com/dlannan/defold-gltf) - Warning: Under construction. Will be a few days to finalize this.
