Exporter: Avoid to export invalid JSON format
See original GitHub issueAFAIK the * .gltf file should be in JSON format: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 »The format combines an easily parseable JSON scene description with one or more binary files representing geometry, animations, and other rich data. Binary data is stored in such a way that it can be loaded directly into GPU buffers without additional parsing or other manipulation.«
The JSON specification doesn’t allow NaN
as a value or number: https://json.org/
Exporting values as NaN breaks reading the glft file with the standard JSON parsers. I couldn’t trigger such a case with the blender-exporter[2] myself, but others claim that it happens https://github.com/godotengine/godot/issues/21668 and try to push workarounds for the JSON parsers in the importer software.
In the attachment, only the first test-cube is validated by the JSON parser as correct.
In the blender-importer [1], the second one stops with python TypeError: list indexes must be integers or slices, not float
, the third one loads without an error, which is in my opinion a mistake.
I have created an issue only here, but it affects both [1] https://github.com/julienduroure/gltf2-blender-importer [2] https://github.com/KhronosGroup/glTF-Blender-Exporter
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
fixed in commit https://github.com/KhronosGroup/glTF-Blender-IO/commit/f430acceef80d35651721f1dd210a4fb3332e572
I rename this bug, as it is only an exporter issue (importer part is solved)