My mistake, fixed

pull/2766/head
bzt 2019-11-18 06:23:41 +01:00
parent 2bd92aeb88
commit 2b252bb9a5
1 changed files with 6 additions and 1 deletions

View File

@ -396,9 +396,14 @@ void M3DImporter::importMeshes()
// we must switch mesh if material changes
if(lastMat != m3d->face[i].materialid) {
lastMat = m3d->face[i].materialid;
if(pMesh && vertices->size() && faces->size()) {
if(pMesh && vertices && vertices->size() && faces && faces->size()) {
populateMesh(pMesh, faces, vertices, normals, texcoords, colors, vertexids);
meshes->push_back(pMesh);
delete faces;
delete vertices;
delete normals;
delete texcoords;
delete colors;
delete vertexids; // this is not stored in pMesh, just to collect bone vertices
}
pMesh = new aiMesh;