I always use the babylon extension to load my 3d models. And today I wanted to give gltf a try to load my characters to see how it would perform in terms of performance. (the character seems to load much faster, which is cool)
I’m hitting a wall with animations now.
I understood that there is an animation group now. But I don’t understand how it works.
I was able to stop all animations with animationGroups[0].stop();
But then I’m lost.
Before I used: avatar.skeleton.createAnimationRange('walk', 0, 100);
Then I could play the animation with: avatar.skeleton.beginAnimation('walk', true, 1.0);
with gltf and animation groups I no longer understand. I have a single animation from 0 to 3000 (which represents several different animations, but joined into one.)
Can I still use createAnimationRange()?
How can I give a name and a start and end key with animation groups as I did with createAnimationRange()
I feel like my model which only contains one long animation of several is not suitable for gltf.
Does that mean that I have to export my animations one by one in a separate file?
I saw this in SceneLoader:
BABYLON.SceneLoader.ImportAnimations('./animations/', 'walk.gltf', scene);
BABYLON.SceneLoader.ImportAnimations('./animations/', 'run.gltf', scene);
let walk = animationGroups[0];
let run = animationGroups[1];
I see. The main issue is that all of the animation clips are in one animation in the glTF. This is not what you should do for glTF. glTF expects separate animation clips to be in separate glTF animations.
There are 3 distinct animations in the model: Survey, Walk, Run. Each of these are in the glTF as separate glTF animations and are loaded as separate Babylon AnimationGroups.
Ideally, in your case, if you can do this on the export of the glTF, then you can simply use Babylon AnimationGroups to play the correct animation instead of trying to split the animation clips at runtime.
Oh, I see in 3ds max that I can create separate group animations with the right click.
I will take a closer look at this. I think I figured out what was wrong.
Thank you very much for your light bghgary
Then I export (here are the parameters that I check)
I specify that I tried to check (animation group) expor No-animated Object But that does not change anything, even seeing my character disappears in Babylon