You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
indices = _decode_accessor_as_ints(p_state, p["indices"], false);
2836
-
constintis = indices.size();
2836
+
constintindex_count = indices.size();
2837
2837
2838
2838
if (primitive == Mesh::PRIMITIVE_TRIANGLES) {
2839
+
if (index_count % 3 != 0) {
2840
+
ERR_PRINT("glTF import: Mesh " + itos(i) + " surface " + itos(j) + " in file " + p_state->filename + " is invalid. Indexed triangle meshes MUST have an index array with a size that is a multiple of 3, but got " + itos(index_count) + " indices.");
2841
+
continue;
2842
+
}
2839
2843
// Swap around indices, convert ccw to cw for front face.
ERR_PRINT("glTF import: Mesh " + itos(i) + " surface " + itos(j) + " in file " + p_state->filename + " is invalid. Non-indexed triangle meshes MUST have a vertex array with a size that is a multiple of 3, but got " + itos(vertex_count) + " vertices.");
ERR_FAIL_COND_MSG(index_count % 3 != 0, "ImporterMesh::generate_lods: Indexed triangle meshes MUST have an index array with a size that is a multiple of 3, but got " + itos(index_count) + " indices. Cannot generate LODs for this invalid mesh.");
0 commit comments