I am using Playground, and the animation plays completely fine on desktop. However, when I export it using the download button on Playground and open the .html file in a phone browser (Chrome), it only plays half the frames
can you share a live repro on the exported version so we can test on our phones?
You can open it in the Playground, export it, and then open the HTML file. But here’s the HTML file, click on the rotation and you’ll see its not rotating 360° even though it does in the Playground.
Blender Animation.zip (3.4 KB)
Let me ping @georgie
Hi @Ren_Renner – the difference in behavior is because your playground link is using babylon toolkit (see the query string parameter in the URL) while the downloaded html is not.
If you remove the QSP from the playground URL, the behavior matches what you see in the exported file
Blender Animation test 01 | Babylon.js Playground
The Babylon toolkit is not directly maintained by the internal dev team, it’s a project by @MackeyK24 – it’s possible the toolkit sets some animation flags that are causing difference in behavior. @MackeyK24 can you provide more context? We may also want to update the download functionality to respect the toolkit behavior when QSP is present
I see but removing “?BabylonToolkit” from the URL still doesn’t change anything.
After tinkering some more, I found that the HTML file behaves the same on desktop too, not just on the phone.
I see it changes the animation behavior (I see the rotation stopping after 2 turns, vs with babylon toolkit i see it rotates ~3 times, but not the full rotation)
I can help debugging why the animation stops after 2 turns!
GLB animations have custom frame ranges, which depend on how they were authored. If you inspect the animation groups associated with the imported glb file (before any modifications), you can see that the rotation goes from 0 to 249.99.
In your code, you are setting the rotation end frame to 120 and then overriding the existing animationGroup called ‘rotate’ – thus causing it to only rotate half way.
In order to get a full rotation, you would need your endFrame to match what the glb expects - so either don’t override the existing defined ‘rotate’ animation group, or ensure that the “Rotate”: { start: 0, end: 120, loop: true },uses that same 249.99 value for the end!
Let me know if you have further questions!
Thanks this is working now. thanks again @georgie and @Deltakosh
FYI… The gltf loader for Babylon Toolkit enabled scenes was setting the GLTF_LOADER targetFps to 30.
As of version 8.6.1 the toolkit now sets the gltf loader targetFps to 60 (the default value)