KhronosGroup / UnityGLTF

Runtime glTF 2.0 Loader for Unity3D
MIT License
1.84k stars 490 forks source link

Runtime export GLB with animation clip #765

Open cyborgs-pro opened 3 months ago

cyborgs-pro commented 3 months ago

I tried exporting GLB via code from the editor, everything works fine. But when I made the build on Android, there was no animation clip inside GLB. The documentation says that exporting animation to runtime is supported. How to make export animation clip on the device in .GLB together with the model?

I use: UnityGLTF.GLTFSceneExporter(---).SaveGLB(---)

cyborgs-pro commented 3 months ago

Ok. I found solution: Use: GLTFRecorderComponent class. It's gonna take some time to record the clip, but it suits me fine.

pfcDorn commented 3 months ago

Indeed AnimationClips themselves can't be exported at runtime, which is a limitation from Unity – the data can only be directly accessed inside the Editor. That's indeed why we're providing the GLTFRecorder class and timeline capabilities, to allow for runtime recording and export.