spnda / fastgltf

A modern C++17 glTF 2.0 library focused on speed, correctness, and usability
https://fastgltf.readthedocs.io/v0.8.x/
MIT License
275 stars 42 forks source link

Parsing error when an animation channel's target has no `node` field #46

Closed Cyphall closed 7 months ago

Cyphall commented 7 months ago

When trying to load a glTF file containing an animation channel with no node field, the parser fails with the error "The glTF is either missing something or has invalid data.".

According to the specs, a channel which does not contain a "node" property is perfectly valid and an implementation should ignore it, unless an extension defines the animated object and the implementation supports this extension.

The nodeIndex member of the AnimationChannel structure should probably be turned into an Optional like other optional properties.

spnda commented 7 months ago

Thanks for reporting. I've fixed this in the linked commit.