spnda / fastgltf

A modern C++17 glTF 2.0 library focused on speed, correctness, and usability

Home Page:https://fastgltf.readthedocs.io/v0.7.x/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong field name for primitive topology when exporting

Cyphall opened this issue · comments

When exporting a glTF file, the topology of primitives is exported in a field called "type":

fastgltf/src/fastgltf.cpp

Lines 4939 to 4941 in 753b161

if (itp->type != PrimitiveType::Triangles) {
json += R"(,"type":)" + std::to_string(to_underlying(itp->type));
}

But the specs say that this field should be called "mode".

commented

First of all, thank you for all of the issues you've found over the past few days and sorry that you had to face them.

For the future, in these cases where the fix is obvious and/or trivial perhaps you could open a pull request directly? I am often at school where I have no way of committing and/or testing changes, and you've always found a correct solution for the issue which you mentioned in the issue. I'd be happy to review and merge those.

First of all, thank you for all of the issues you've found over the past few days and sorry that you had to face them.

It's normal, export is a fairly new feature and you don't have the resources a company would have to fully test it before release 😃

For the future, in these cases where the fix is obvious and/or trivial perhaps you could open a pull request directly?

Sure!