I can do that. For an accurate test should I use the .glb model that I created? If so is there a way to upload the model or should I host the model somewhere I have access to? I would think it would be easy to reproduce seeing I am using a model directly exported from the Babylonjs 3ds max exporter. I was trying to import it by model name. I don’t see many babylonjs examples doing this method. I was giving the option and it just seemed natural to me.
Sorry for the slow response. It’s been a busy few days.
I’m not sure I understand what is wrong. I don’t see bad animation data with this PG. I just see a whole bunch of empty animation groups. This is because the animation channels are ignored if they target a node that doesn’t exist. Since you only allowed the “Woody” name, all of the bone nodes are not loaded and thus none of the animations can target the bone nodes which results in all the animations getting ignored.
That’s a fair point. The animation group should probably be removed if none of the channels got created. I will submit a fix for this.
Your original post is indicating there is some kind of invalid data. None of the values I’m seeing are invalid. The defaults of an animation group for from and to are -Number.MAX_VALUE and Number.MAX_VALUE respectively which makes sense in my opinion. Where does it “breaks the app on parse”?
I pasted an image above with the number. Testing on multiple platforms, Safari on IOS threw the parse error on -Number.MAX_VALUE when importing the GLB file. This is how I discovered the problem. You might find this in other places of Bablyonjs.
Chrome Android can handle the import but just wouldn’t play the animation.
I haven’t dived to much into the GLTF spec. Off the top of my head, what I remember it is using JSON for the raw model data. GLB I’m guessing is a zip package with the GLTF and textures all in one package. It sounds like the 3d model builder at one point of the system needs a JSON parser to build the model.
I understand the reason for the use of MAX and MIN Number, it might be safer to not use them in the model converter. It looks like you solved the issue by not including the animation data at all. When I see those MIN MAX numbers I do assume something went wrong. Showing a little empathy to your user could you have used zero? Avoiding those large numbers? It wasn’t obvious to me the BabylonJS untrained eye that it was an empty animation data. That would have read as an empty animation data. Start 0, End 0
Disclaimer: I am member of the Khronos 3D formats working group and have been involved in the glTF spec for a number of years.
Yes, glTF is based on JSON, but Number.MaxValue and Number.MinValue is not part of the parsing of the glTF file. I’m not sure where this is coming from. Will have to investigate to find out.
These values are the defaults of an AnimationGroup object. Showing Start 0 / End 0 maybe okay for the UI, I would not do it in the code as that will require extra logic. Also, Start 0 / End 0 is technically a valid range for an animation (i.e. one frame), so maybe the UI should just show something that indicates the group is empty.