From 22bdd2b7a04dd658665c8f99a08dd7880b092ad6 Mon Sep 17 00:00:00 2001 From: Mike Baran Date: Wed, 19 Jan 2022 15:35:36 -0500 Subject: [PATCH] Don't allow empty URIs as two or more textures could stomp on eachother --- src/meshlabplugins/io_gltf/gltf_loader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/meshlabplugins/io_gltf/gltf_loader.cpp b/src/meshlabplugins/io_gltf/gltf_loader.cpp index 9a9f95d71..c92cf0194 100644 --- a/src/meshlabplugins/io_gltf/gltf_loader.cpp +++ b/src/meshlabplugins/io_gltf/gltf_loader.cpp @@ -331,6 +331,10 @@ void loadMeshPrimitive( QImage qimg(img.image.data(), img.width, img.height, QImage::Format_RGBA8888); if (!qimg.isNull()){ QImage copy = qimg.copy(); + if (uri.empty()) + { + uri = "texture_" + std::to_string(textureImg); + } m.addTexture(uri, copy); } else {