diff --git a/CMakeLists.txt b/CMakeLists.txt index aabadea15..b9f42eaf1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,7 @@ EXECUTE_PROCESS( # Get the latest abbreviated commit hash of the working branch EXECUTE_PROCESS( - COMMAND git log -1 --format=%h + COMMAND git log -1 --format=%h --no-show-signature WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE 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)); diff --git a/port/PyAssimp/pyassimp/helper.py b/port/PyAssimp/pyassimp/helper.py index 7d9282745..f9163de2a 100644 --- a/port/PyAssimp/pyassimp/helper.py +++ b/port/PyAssimp/pyassimp/helper.py @@ -27,7 +27,7 @@ additional_dirs, ext_whitelist = [],[] if os.name=='posix': additional_dirs.append('./') additional_dirs.append('/usr/lib/') - additional_dirs.append('/usr/lib/x86_64-linux-gnu') + additional_dirs.append('/usr/lib/x86_64-linux-gnu/') additional_dirs.append('/usr/local/lib/') if 'LD_LIBRARY_PATH' in os.environ: @@ -222,11 +222,17 @@ def search_library(): for filename in os.listdir(curfolder): # our minimum requirement for candidates is that # they should contain 'assimp' somewhere in - # their name - if filename.lower().find('assimp')==-1 or\ - os.path.splitext(filename)[-1].lower() not in ext_whitelist: + # their name + if filename.lower().find('assimp')==-1 : continue - + is_out=1 + for et in ext_whitelist: + if et in filename.lower(): + is_out=0 + break + if is_out: + continue + library_path = os.path.join(curfolder, filename) logger.debug('Try ' + library_path) try: 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 ) {