From 89b90cf2d57462df8c78720ef4402247f1d8ce16 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 23 Jun 2018 20:18:27 +0200 Subject: [PATCH 1/2] Check nb of faces and vertices for FBX unit test This test is currently broken ! --- test/unit/utFBXImporterExporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/utFBXImporterExporter.cpp b/test/unit/utFBXImporterExporter.cpp index d2576cfa1..1d6cdf883 100644 --- a/test/unit/utFBXImporterExporter.cpp +++ b/test/unit/utFBXImporterExporter.cpp @@ -70,6 +70,10 @@ TEST_F( utFBXImporterExporter, importBareBoxWithoutColorsAndTextureCoords ) { Assimp::Importer importer; const aiScene *scene = importer.ReadFile( ASSIMP_TEST_MODELS_DIR "/FBX/box.fbx", aiProcess_ValidateDataStructure ); EXPECT_NE( nullptr, scene ); + EXPECT_EQ(scene->mNumMeshes, 1); + aiMesh* mesh = scene->mMeshes[0]; + EXPECT_EQ(mesh->mNumFaces, 12); + EXPECT_EQ(mesh->mNumVertices, 36); } TEST_F( utFBXImporterExporter, importPhongMaterial ) { From de8adacb54570ca58aa233ed59e5210cefb6f497 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 23 Jun 2018 20:25:31 +0200 Subject: [PATCH 2/2] Fix regression on FBX importer unit test box.fbx was broken since b28bcc commit. --- code/FBXMeshGeometry.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/FBXMeshGeometry.cpp b/code/FBXMeshGeometry.cpp index cc1a5a83e..8bfd60570 100644 --- a/code/FBXMeshGeometry.cpp +++ b/code/FBXMeshGeometry.cpp @@ -437,6 +437,9 @@ void ResolveVertexDataArray(std::vector& data_out, const Scope& source, // deal with this more elegantly and with less redundancy, but right // now it seems unavoidable. if (MappingInformationType == "ByVertice" && isDirect) { + if (!HasElement(source, indexDataElementName)) { + return; + } std::vector tempData; ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));