-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLTF/GLB with multiple Animations Doesn't work #476
Comments
Has anyone got a fix for this? I have been trying for multiple animations and it's not going anywhere.Only one is getting played from many animations on load of .gltf file. |
I am also facing this issue. |
I am using a different GLTF loader written by a third party and it can import all animations |
HenkHull, what loader are you using? |
@HenkHull I would also be interested to hear how you integrated a third-party loader within UnityGLTF. |
Hi! I came across the same problem a few weeks ago and as I don't see any other solution this is my approach:
I don't know if there is a better solution out there but I've tested with a couple of models and they work now :) |
Hi. I tested this fix, that's also work for the models I have. Thank you for that. Is there an official fix or maybe you can create a PR ? Best, |
Please update to the latest version and open a new issue if the problem persists. Thanks! |
Using GLTFComponent Script to Load GLB from Assets...
I tried several files which contain some animations.....
*File which contained only 1 animation loaded fine. an example file is
robot.glb.zip
*Files which contained more animations didn't loaded. : e.g
Bee.glb.zip
I got these Errors:
Error 1. (IndexOutOfRangeException: Index was outside the bounds of the array.)
in Code Below
Error 2: (Unity does not allow you to put two keyframes in with the same time, so this should never occur)
In Code Below:
Issue Details:
So basically the problem is when i try to load the file with more than 1 animations, UnityGLTF cant load it. and it crashes on line "var key = curve.keys[keyframeIndex];" in method named "SetTangentMode()" in script "GLTFSceneImporter.cs."
I tried to debug, and the error is due to the array "curve.key[]" because the length of this array is being reduced in size after some iterations in loop. i couldn't figure out why... e.g initially it's length was 34, but after 8th iteration.. the size becomes 33... and after a while 32.... i have no clue why... and when the loop tries to access the 33th index.... its fails.
you can reproduce the error by using the attached files below.
Bee.glb.zip
blue_whale_-_textured.zip
wolf.glb.zip
The text was updated successfully, but these errors were encountered: