Closed Cyphall closed 8 months ago
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:
fastgltf::FileExporter::setBufferPath
"."
"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).
Thank you :smiley:
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: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).