mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 03:06:01 +08:00
if image.uri empty, should use bufferview
if uri empty, shoud use mimeType and bufferview
This commit is contained in:
parent
d11a4c4d71
commit
62be8d04cf
@ -4892,7 +4892,14 @@ static void SerializeGltfBufferView(BufferView &bufferView, json &o) {
|
||||
}
|
||||
|
||||
static void SerializeGltfImage(Image &image, json &o) {
|
||||
SerializeStringProperty("uri", image.uri, 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user