mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 13:45:56 +08:00
Merge pull request #161 from rainliang000/patch-1
if image.uri empty, should use image.bufferView
This commit is contained in:
commit
8f67121deb
@ -4892,7 +4892,14 @@ static void SerializeGltfBufferView(BufferView &bufferView, json &o) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void SerializeGltfImage(Image &image, 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()) {
|
if (image.name.size()) {
|
||||||
SerializeStringProperty("name", image.name, o);
|
SerializeStringProperty("name", image.name, o);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user