[SOLVED] GLTF Animation Problem

Hello Guys,
I have an issue with a model downloaded from sketchfab.com - some of its animations have a noticeable delay (sometimes 2-3 seconds) before they start (see video below). It only happens when running them using JME. On sketchfab its working fine.

You can download the model from this link:

What do you think might be the problem?

Adi

1 Like

If you load it in this online Gltf viewer you will notice the same delay on animations.

https://gltf-viewer.donmccurdy.com/

Edit:

You can also notice the same delay if you load it in Blender.
Problem is animations are not start at fame 0. For example hit animation starts at frame 200.

4 Likes

Also, a note… sometimes the sketchfab viewer is doing some magic, I guess. I’ve downloaded things like Victorian houses that on sketchfab have shingled roofs and stuff… but none of the downloaded models have any of those textures. It’s very strange.

…so it wouldn’t surprise me if there’s some magic cleaning up bad animations or someone just hand-fixed it or something. I have no idea why the displayed model is sometimes different than the downloaded one.

2 Likes

When AnimComposer plays a clip, it starts the clip at t=0. You should be able to override that default using AnimComposer.setTime().

Edit: If setting the time is impractical for some reason, you could edit the animation instead. The free Wes Animation Toolkit includes a utility method to trim an animation clip in the time domain:

https://github.com/stephengold/Wes/blob/11c9a2762fbf7580e78860891766cb138bffc486/WesLibrary/src/main/java/jme3utilities/wes/AnimationEdit.java#L156

The toolkit includes an example that uses this method:

https://github.com/stephengold/Wes/blob/11c9a2762fbf7580e78860891766cb138bffc486/WesExamples/src/main/java/jme3utilities/test/wes/TrimAnimation.java#L161

3 Likes

Did you solve the issue with the zombie model?

Since it’s not JME issue I tend not to fix it by coding a workaround but to fix / replace the model.
Easiest way for me is to load it into Blender and fix it there.
Thanks for the support!

1 Like