Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer URIs are exported with backslash as directory separator on Windows #51

Closed
Cyphall opened this issue Mar 6, 2024 · 1 comment
Closed
Labels
bug Something isn't working done Everything has been addressed

Comments

@Cyphall
Copy link
Contributor

Cyphall commented Mar 6, 2024

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).

@spnda spnda added the bug Something isn't working label Mar 6, 2024
@spnda spnda closed this as completed in b0ba871 Mar 6, 2024
@spnda spnda added the done Everything has been addressed label Mar 6, 2024
@Cyphall
Copy link
Contributor Author

Cyphall commented Mar 6, 2024

Thank you 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done Everything has been addressed
Projects
None yet
Development

No branches or pull requests

2 participants