Merge pull request #2037 from aavenel/fix/FBXImportRegression

Fix fbx import regression
pull/1508/head^2
Kim Kulling 2018-06-25 20:12:10 +02:00 committed by GitHub
commit bca41ceba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -437,6 +437,9 @@ void ResolveVertexDataArray(std::vector<T>& 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<T> tempData;
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));

View File

@ -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 ) {