Closed ptc-tgamper closed 7 months ago
Good catch!
This reminds me this issue: https://github.com/syoyo/tinygltf/pull/295
Probably we also need to apply this fix to other glTF objects: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-gltf
It seems an empty scene causes the same problem.
You can contribute a fix! PR is much appreciated.
Will do.
🙏
Describe the issue
GLTF allows nodes to be empty, but not to be null. But tinygltf serializes empty nodes as a json::null object. The underlying reason is that the default constructor for detail::json (be it nlohmann or rapidjson) initializes the json object to a null object.
To Reproduce
The resulting gltf is invalid:
Expected behaviour
The empty nodes should be serialised as an empty json object, i.e. {} instead of null.
Additional context:
Validation error message: