Add check for NULL texcoord values.
parent
50a95ad0f2
commit
f63caf894e
|
@ -437,6 +437,12 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) {
|
for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) {
|
||||||
|
if (!attr.texcoord[tc]) {
|
||||||
|
DefaultLogger::get()->warn("NULL texcoord encountered in mesh \"" + mesh.name +
|
||||||
|
"\" and will be ignored");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (attr.texcoord[tc]->count != aim->mNumVertices) {
|
if (attr.texcoord[tc]->count != aim->mNumVertices) {
|
||||||
DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name +
|
DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name +
|
||||||
"\" does not match the vertex count");
|
"\" does not match the vertex count");
|
||||||
|
|
Loading…
Reference in New Issue