if image.uri empty, should use bufferview

if uri empty, shoud use mimeType and bufferview
This commit is contained in:
rainliang000 2019-04-29 09:54:27 +08:00 committed by GitHub
parent d11a4c4d71
commit 62be8d04cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4892,7 +4892,14 @@ static void SerializeGltfBufferView(BufferView &bufferView, json &o) {
}
static void SerializeGltfImage(Image &image, json &o) {
// if uri empty, the mimeType and bufferview should be set
if (image.uri.empty()) {
SerializeStringProperty("mimeType", image.mimeType, o);
SerializeNumberProperty<int>("bufferView", image.bufferView, o);
}
else {
SerializeStringProperty("uri", image.uri, o);
}
if (image.name.size()) {
SerializeStringProperty("name", image.name, o);