Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/gltf/GltfModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,14 @@ class GltfModel {
if (!holder.ptrs.empty()) {
std::vector<json> bits;
for (const auto& ptr : holder.ptrs) {
bits.push_back(ptr->serialize());
json bit = ptr->serialize();
if (!bit.empty()) {
bits.push_back(ptr->serialize());
}
}
if (!bits.empty()) {
glTFJson[key] = bits;
}
glTFJson[key] = bits;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/gltf/properties/BufferData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ BufferData::BufferData(
: Holdable(), isGlb(false), uri(isEmbedded ? "" : std::move(uri)), binData(binData) {}

json BufferData::serialize() const {
if (binData->empty()) {
return json{};
}

json result{{"byteLength", binData->size()}};
if (!isGlb) {
if (!uri.empty()) {
Expand Down