Buffer URIs are exported with backslash as directory separator on Windows
Cyphall opened this issue · comments
Cyphall commented
Calling fastgltf::FileExporter::setBufferPath
with "."
and adding a buffer named "test" results in the buffer URI having a backslash as separator in the generated glTF file:
"buffers":[
{
"uri":".\\test.bin",
"byteLength":720,
"name":"test"
}
],
However, URIs are expected to only ever use forward slashes as separators.
This makes the glTF file invalid.
After going through the code, I believe that this issue is caused by the use of std::filesystem::path::string (which uses the native separators) instead of std::filesystem::path::generic_string (which always uses forward slashes as separators).
Cyphall commented
Thank you 😃