From 8334bb579c4e639c0e22fc80ebe94d1e87f69a5d Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Sat, 16 Jun 2018 09:29:18 +0200 Subject: [PATCH 1/6] Hide commit signature information when fetching commit hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If someone configures git to always show a commit’s signing information, this breaks the definition of GitVersion in revision.h: ``` #ifndef ASSIMP_REVISION_H_INC #define ASSIMP_REVISION_H_INC #define GitVersion 0xgpg: Signature faite le Fri 15 Jun 2018 20:39:53 CEST gpg: avec la clef RSA 4AEE18F83AFDEB23 gpg: Impossible de vérifier la signature : Pas de clef publique 878b4b2c #define GitBranch "master" #endif // ASSIMP_REVISION_H_INC ``` This can be avoided by passing the `--no-show-signature` to the `git log` command for retrieving the hash. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5a7bc278..9d13db57a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,7 +152,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 From 7b0f100fc3c988438702eba132510139cd399732 Mon Sep 17 00:00:00 2001 From: Ravin Kumar Date: Fri, 22 Jun 2018 12:22:27 +0530 Subject: [PATCH 2/6] Solved pyassimp.errors.AssimpError in conda This error occurred because of error in finding .extension files. os.path.splitext(filename)[-1].lower() not in ext_whitelist: ### this line had bugs, failed to select files with extensions .so.x [.so.1 .so.2 .so.3.1] but worked on simple extensions only. like- .so .dll Added a mechanism to remove this bug. --- port/PyAssimp/pyassimp/helper.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/port/PyAssimp/pyassimp/helper.py b/port/PyAssimp/pyassimp/helper.py index 7d9282745..4082a4b76 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: @@ -223,10 +223,25 @@ def search_library(): # 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: + + + #if filename.lower().find('assimp')==-1 or\ + # os.path.splitext(filename)[-1].lower() not in ext_whitelist: ### this line had bugs, failed to select files with extensions .so.x [.so.1 .so.2 .so.3.1] + # continue ### worked on simple extensions only. like- .so .dll + + + ##### Modified Code --- to correctly select extension files ##### + 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 + ##### Modified Code --- to correctly select extension files ##### + library_path = os.path.join(curfolder, filename) logger.debug('Try ' + library_path) try: From 4a720511e4afe8f61023ceefe406dee702073957 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 22 Jun 2018 16:13:46 +0200 Subject: [PATCH 3/6] Update helper.py Remove dead code. --- port/PyAssimp/pyassimp/helper.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/port/PyAssimp/pyassimp/helper.py b/port/PyAssimp/pyassimp/helper.py index 4082a4b76..e0ee0ccbf 100644 --- a/port/PyAssimp/pyassimp/helper.py +++ b/port/PyAssimp/pyassimp/helper.py @@ -222,15 +222,7 @@ 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: ### this line had bugs, failed to select files with extensions .so.x [.so.1 .so.2 .so.3.1] - # continue ### worked on simple extensions only. like- .so .dll - - - ##### Modified Code --- to correctly select extension files ##### + # their name if filename.lower().find('assimp')==-1 : continue is_out=1 From d4c7eb3b676fc6455a085444fcaf193edff0a777 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 22 Jun 2018 16:14:20 +0200 Subject: [PATCH 4/6] Update helper.py Remove deprecated comment. --- port/PyAssimp/pyassimp/helper.py | 1 - 1 file changed, 1 deletion(-) diff --git a/port/PyAssimp/pyassimp/helper.py b/port/PyAssimp/pyassimp/helper.py index e0ee0ccbf..f9163de2a 100644 --- a/port/PyAssimp/pyassimp/helper.py +++ b/port/PyAssimp/pyassimp/helper.py @@ -232,7 +232,6 @@ def search_library(): break if is_out: continue - ##### Modified Code --- to correctly select extension files ##### library_path = os.path.join(curfolder, filename) logger.debug('Try ' + library_path) From 89b90cf2d57462df8c78720ef4402247f1d8ce16 Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 23 Jun 2018 20:18:27 +0200 Subject: [PATCH 5/6] 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 6/6] 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));