From b71b7982b5012d5a233b519511d9f33bd272447c Mon Sep 17 00:00:00 2001 From: Alexandre Avenel Date: Sat, 8 Dec 2018 22:58:24 +0100 Subject: [PATCH 1/5] Add silent flag to assimp cmd Add a new command line flag to assimp cmd in order to only display minimal info when loading a file. This is especially useful for quick profiling/fuzzing. --- tools/assimp_cmd/Info.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index ae858bfe8..d6d3de804 100644 --- a/tools/assimp_cmd/Info.cpp +++ b/tools/assimp_cmd/Info.cpp @@ -54,7 +54,8 @@ const char* AICMD_MSG_INFO_HELP_E = "assimp info [-r] [-v]\n" "\tPrint basic structure of a 3D model\n" "\t-r,--raw: No postprocessing, do a raw import\n" -"\t-v,--verbose: Print verbose info such as node transform data\n"; +"\t-v,--verbose: Print verbose info such as node transform data\n" +"\t-s, --silent: Print only minimal info\n"; const std::string TREE_BRANCH_ASCII = "|-"; const std::string TREE_BRANCH_UTF8 = "\xe2\x94\x9c\xe2\x95\xb4"; @@ -305,6 +306,7 @@ int Assimp_Info (const char* const* params, unsigned int num) // get -r and -v arguments bool raw = false; bool verbose = false; + bool silent = false; for(unsigned int i = 1; i < num; ++i) { if (!strcmp(params[i],"--raw")||!strcmp(params[i],"-r")) { raw = true; @@ -312,6 +314,9 @@ int Assimp_Info (const char* const* params, unsigned int num) if (!strcmp(params[i],"--verbose")||!strcmp(params[i],"-v")) { verbose = true; } + if (!strcmp(params[i], "--silent") || !strcmp(params[i], "-s")) { + silent = true; + } } // do maximum post-processing unless -r was specified @@ -380,6 +385,12 @@ int Assimp_Info (const char* const* params, unsigned int num) ) ; + if (silent) + { + printf("\n"); + return 0; + } + // meshes if (scene->mNumMeshes) { printf("\nMeshes: (name) [vertices / bones / faces | primitive_types]\n"); From 3c1d6a3f874b3298f1fd6b8487a03e2f1d92f9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Iraolagoit=C3=ADa?= Date: Wed, 19 Dec 2018 20:28:43 -0300 Subject: [PATCH 2/5] Fix animations import in gltf2 --- code/glTF2Importer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 67c26bf62..107281a33 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -1033,12 +1033,12 @@ void glTF2Importer::ImportAnimations(glTF2::Asset& r) std::unordered_map samplers = GatherSamplers(anim); - ai_anim->mNumChannels = r.skins[0].jointNames.size(); + ai_anim->mNumChannels = samplers.size(); if (ai_anim->mNumChannels > 0) { ai_anim->mChannels = new aiNodeAnim*[ai_anim->mNumChannels]; int j = 0; - for (auto& iter : r.skins[0].jointNames) { - ai_anim->mChannels[j] = CreateNodeAnim(r, *iter, samplers[iter.GetIndex()]); + for (auto& iter : samplers) { + ai_anim->mChannels[j] = CreateNodeAnim(r, r.nodes[iter.first], iter.second); ++j; } } From 7ce8c9778b56a59912668a2ef9aa8729202c8809 Mon Sep 17 00:00:00 2001 From: Maxim Petrovsky Date: Thu, 20 Dec 2018 16:50:38 +0200 Subject: [PATCH 3/5] added arm64e to iOS build script added arm64e iOS cmake file --- port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake | 17 +++++++++++++++++ port/iOS/build.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake diff --git a/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake new file mode 100644 index 000000000..0cf2b6b66 --- /dev/null +++ b/port/iOS/IPHONEOS_ARM64E_TOOLCHAIN.cmake @@ -0,0 +1,17 @@ +INCLUDE(CMakeForceCompiler) + +SET (CMAKE_CROSSCOMPILING TRUE) +SET (CMAKE_SYSTEM_NAME "Darwin") +SET (CMAKE_SYSTEM_PROCESSOR "arm64e") +SET (IOS TRUE) + +SET (IOS_SDK_DEVICE iPhoneOS) + +SET (SDKVER "${IOS_SDK_VERSION}") +SET (DEVROOT "${XCODE_ROOT_DIR}/Platforms/${IOS_SDK_DEVICE}.platform/Developer") + + +SET (CMAKE_FIND_ROOT_PATH "${SDKROOT}" "${DEVROOT}") +SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) \ No newline at end of file diff --git a/port/iOS/build.sh b/port/iOS/build.sh index 288c9c4a4..f118c45c1 100755 --- a/port/iOS/build.sh +++ b/port/iOS/build.sh @@ -31,7 +31,7 @@ TOOLCHAIN=$XCODE_ROOT_DIR/Toolchains/XcodeDefault.xctoolchain CMAKE_C_COMPILER=$(xcrun -find cc) CMAKE_CXX_COMPILER=$(xcrun -find c++) -BUILD_ARCHS_DEVICE="arm64 armv7s armv7" +BUILD_ARCHS_DEVICE="arm64e arm64 armv7s armv7" BUILD_ARCHS_SIMULATOR="x86_64 i386" BUILD_ARCHS_ALL=($BUILD_ARCHS_DEVICE $BUILD_ARCHS_SIMULATOR) From b4c427912f1f4875cdcb524b1a6a6fbc5fe33bdd Mon Sep 17 00:00:00 2001 From: Maxim Petrovsky Date: Thu, 20 Dec 2018 16:51:01 +0200 Subject: [PATCH 4/5] added bitcode ios --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 645d92689..a97174de4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,7 @@ IF (IOS) IF (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Release") ENDIF (NOT CMAKE_BUILD_TYPE) + ADD_DEFINITIONS(-DENABLE_BITCODE) ENDIF (IOS) # Use subset of Windows.h @@ -126,6 +127,7 @@ if (WIN32) ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) endif() + IF(MSVC) OPTION( ASSIMP_INSTALL_PDB "Install MSVC debug files." From 194b59b3b21050f6516725e5b18d76829504a863 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 22 Dec 2018 09:12:10 +0100 Subject: [PATCH 5/5] Update Info.cpp Add a simple check to avoid verbose + silent mode together, --- tools/assimp_cmd/Info.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/assimp_cmd/Info.cpp b/tools/assimp_cmd/Info.cpp index d6d3de804..050dbf989 100644 --- a/tools/assimp_cmd/Info.cpp +++ b/tools/assimp_cmd/Info.cpp @@ -319,6 +319,12 @@ int Assimp_Info (const char* const* params, unsigned int num) } } + // Verbose and silent at the same time are not allowed + if ( verbose && silent ) { + printf("assimp info: Invalid arguments, verbose and silent at the same time are forbitten. "); + return 1; + } + // do maximum post-processing unless -r was specified ImportData import; if (!raw) {