Skip to content

Exporting as glb with embedded buffer does not work for fastgltf::sources::ByteView #48

@Cyphall

Description

@Cyphall

Seems to be caused by the sources::ByteView case missing the if statement present in sources::Array and sources::Vector:

fastgltf/src/fastgltf.cpp

Lines 4189 to 4211 in f8ed5a0

[&](const sources::Array& vector) {
if (bufferIdx == 0 && exportingBinary) {
bufferPaths.emplace_back(std::nullopt);
return;
}
auto path = getBufferFilePath(asset, bufferIdx);
json += std::string(R"("uri":")") + fg::escapeString(path.string()) + '"' + ',';
bufferPaths.emplace_back(path);
},
[&](const sources::Vector& vector) {
if (bufferIdx == 0 && exportingBinary) {
bufferPaths.emplace_back(std::nullopt);
return;
}
auto path = getBufferFilePath(asset, bufferIdx);
json += std::string(R"("uri":")") + fg::escapeString(path.string()) + '"' + ',';
bufferPaths.emplace_back(path);
},
[&](const sources::ByteView& view) {
auto path = getBufferFilePath(asset, bufferIdx);
json += std::string(R"("uri":")") + fg::escapeString(path.string()) + '"' + ',';
bufferPaths.emplace_back(path);
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions