diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 08292d55f..e542821e8 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -44,16 +44,46 @@ jobs: with: CXX: ${{ matrix.cxx }} CC: ${{ matrix.cc }} + + - name: Cache DX SDK + id: dxcache + if: matrix.name == 'windows-msvc' + uses: actions/cache@v2 + with: + path: '${{ github.workspace }}/DX_SDK' + key: ${{ runner.os }}-DX_SDK + restore-keys: | + ${{ runner.os }}-DX_SDK + + - name: Download DXSetup + if: matrix.name == 'windows-msvc' && steps.dxcache.outputs.cache-hit != 'true' + run: | + curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe + cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK" + + - name: Set Windows specific CMake arguments + if: matrix.name == 'windows-msvc' + id: windows_extra_cmake_args + run: echo "::set-output name=args::'-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1'" - name: configure and build uses: lukka/run-cmake@v2 + env: + DXSDK_DIR: '${{ github.workspace }}/DX_SDK' + with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }}' buildWithCMakeArgs: '-- -v' buildDirectory: '${{ github.workspace }}/build/' - name: test run: cd build/bin && ./unit shell: bash + + - uses: actions/upload-artifact@v2 + if: matrix.name == 'windows-msvc' + with: + name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}' + path: build/bin diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b350f6e3..23725381d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,8 @@ option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) IF(ASSIMP_HUNTER_ENABLED) include("cmake/HunterGate.cmake") HunterGate( - URL "https://github.com/ruslo/hunter/archive/v0.23.176.tar.gz" - SHA1 "2e9ae973d028660b735ac4c6142725ca36a0048a" + URL "https://github.com/cpp-pm/hunter/archive/v0.23.261.tar.gz" + SHA1 "1540dad7b97c849784a09e8c452ba811c9f71ba2" ) add_definitions(-DASSIMP_USE_HUNTER) @@ -357,6 +357,34 @@ IF (NOT TARGET uninstall) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") ENDIF() +# cmake configuration files +if(${BUILD_SHARED_LIBS}) + set(BUILD_LIB_TYPE SHARED) +else() + set(BUILD_LIB_TYPE STATIC) +endif() + +IF( UNIX ) + # Use GNUInstallDirs for Unix predefined directories + INCLUDE(GNUInstallDirs) + + SET( ASSIMP_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) + SET( ASSIMP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + SET( ASSIMP_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) +ELSE() + # Cache these to allow the user to override them on non-Unix platforms + SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING + "Path the built library files are installed to." ) + SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING + "Path the header files are installed to." ) + SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING + "Path the tool executables are installed to." ) + + SET(CMAKE_INSTALL_FULL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_INCLUDE_INSTALL_DIR}) + SET(CMAKE_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}) + SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_BIN_INSTALL_DIR}) +ENDIF() + IF(ASSIMP_HUNTER_ENABLED) set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}") set(INCLUDE_INSTALL_DIR "include") @@ -395,34 +423,6 @@ IF(ASSIMP_HUNTER_ENABLED) DESTINATION "${CONFIG_INSTALL_DIR}" ) ELSE() - # cmake configuration files - if(${BUILD_SHARED_LIBS}) - set(BUILD_LIB_TYPE SHARED) - else() - set(BUILD_LIB_TYPE STATIC) - endif() - - IF( UNIX ) - # Use GNUInstallDirs for Unix predefined directories - INCLUDE(GNUInstallDirs) - - SET( ASSIMP_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) - SET( ASSIMP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) - SET( ASSIMP_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) - ELSE() - # Cache these to allow the user to override them on non-Unix platforms - SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING - "Path the built library files are installed to." ) - SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING - "Path the header files are installed to." ) - SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING - "Path the tool executables are installed to." ) - - SET(CMAKE_INSTALL_FULL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_INCLUDE_INSTALL_DIR}) - SET(CMAKE_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}) - SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_BIN_INSTALL_DIR}) - ENDIF() - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE) CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE) IF (is_multi_config) diff --git a/cmake/assimp-hunter-config.cmake.in b/cmake/assimp-hunter-config.cmake.in index 34762ac54..8707602e5 100644 --- a/cmake/assimp-hunter-config.cmake.in +++ b/cmake/assimp-hunter-config.cmake.in @@ -2,7 +2,7 @@ find_package(RapidJSON CONFIG REQUIRED) find_package(ZLIB CONFIG REQUIRED) -find_package(utf8 CONFIG REQUIRED) +find_package(utf8cpp CONFIG REQUIRED) find_package(irrXML CONFIG REQUIRED) find_package(minizip CONFIG REQUIRED) find_package(openddlparser CONFIG REQUIRED) diff --git a/code/AssetLib/MMD/MMDPmxParser.cpp b/code/AssetLib/MMD/MMDPmxParser.cpp index 6421f38cb..7ac5ac399 100644 --- a/code/AssetLib/MMD/MMDPmxParser.cpp +++ b/code/AssetLib/MMD/MMDPmxParser.cpp @@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "MMDPmxParser.h" #include #ifdef ASSIMP_USE_HUNTER -# include +# include #else # include "../contrib/utf8cpp/source/utf8.h" #endif diff --git a/code/AssetLib/SIB/SIBImporter.cpp b/code/AssetLib/SIB/SIBImporter.cpp index b36c6d9b1..33beb0087 100644 --- a/code/AssetLib/SIB/SIBImporter.cpp +++ b/code/AssetLib/SIB/SIBImporter.cpp @@ -59,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #ifdef ASSIMP_USE_HUNTER -#include +#include #else //# include "../contrib/ConvertUTF/ConvertUTF.h" #include "../contrib/utf8cpp/source/utf8.h" diff --git a/code/AssetLib/STEPParser/STEPFileEncoding.cpp b/code/AssetLib/STEPParser/STEPFileEncoding.cpp index d917c28f3..1d1150c08 100644 --- a/code/AssetLib/STEPParser/STEPFileEncoding.cpp +++ b/code/AssetLib/STEPParser/STEPFileEncoding.cpp @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "STEPFileEncoding.h" #include #ifdef ASSIMP_USE_HUNTER -# include +# include #else # include #endif diff --git a/code/AssetLib/X3D/FIReader.cpp b/code/AssetLib/X3D/FIReader.cpp index de9f035f2..c1b439bda 100644 --- a/code/AssetLib/X3D/FIReader.cpp +++ b/code/AssetLib/X3D/FIReader.cpp @@ -61,7 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #ifdef ASSIMP_USE_HUNTER -# include +# include #else # include "../contrib/utf8cpp/source/utf8.h" #endif diff --git a/code/AssetLib/glTF/glTFAsset.h b/code/AssetLib/glTF/glTFAsset.h index d6d1dd372..15947c8c6 100644 --- a/code/AssetLib/glTF/glTFAsset.h +++ b/code/AssetLib/glTF/glTFAsset.h @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef GLTFASSET_H_INC #define GLTFASSET_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_IMPORTER) #include diff --git a/code/AssetLib/glTF/glTFAsset.inl b/code/AssetLib/glTF/glTFAsset.inl index a5e539345..472be41cf 100644 --- a/code/AssetLib/glTF/glTFAsset.inl +++ b/code/AssetLib/glTF/glTFAsset.inl @@ -836,8 +836,8 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) { if (json_extensions == nullptr) goto mr_skip_extensions; - for (Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); it_memb++) { #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + for (Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); it_memb++) { if (it_memb->name.GetString() == std::string("Open3DGC-compression")) { // Search for compressed data. // Compressed data contain description of part of "buffer" which is encoded. This part must be decoded and @@ -887,11 +887,11 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) { Extension.push_back(ext_o3dgc); // store info in mesh extensions list. } // if(it_memb->name.GetString() == "Open3DGC-compression") else -#endif { throw DeadlyImportError(std::string("GLTF: Unknown mesh extension: \"") + it_memb->name.GetString() + "\"."); } } // for(Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); json_extensions++) +#endif mr_skip_extensions: diff --git a/code/AssetLib/glTF/glTFAssetWriter.h b/code/AssetLib/glTF/glTFAssetWriter.h index f166ee532..ed81d12cd 100644 --- a/code/AssetLib/glTF/glTFAssetWriter.h +++ b/code/AssetLib/glTF/glTFAssetWriter.h @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef GLTFASSETWRITER_H_INC #define GLTFASSETWRITER_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_IMPORTER) #include "glTFAsset.h" diff --git a/code/AssetLib/glTF/glTFAssetWriter.inl b/code/AssetLib/glTF/glTFAssetWriter.inl index 779c8ce58..8db507c7e 100644 --- a/code/AssetLib/glTF/glTFAssetWriter.inl +++ b/code/AssetLib/glTF/glTFAssetWriter.inl @@ -305,11 +305,11 @@ namespace glTF { Value json_extensions; json_extensions.SetObject(); +#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC for(Mesh::SExtension* ptr_ext : m.Extension) { switch(ptr_ext->Type) { -#ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC case Mesh::SExtension::EType::Compression_Open3DGC: { Value json_comp_data; @@ -339,11 +339,11 @@ namespace glTF { } break; -#endif default: throw DeadlyImportError("GLTF: Can not write mesh: unknown mesh extension, only Open3DGC is supported."); }// switch(ptr_ext->Type) }// for(Mesh::SExtension* ptr_ext : m.Extension) +#endif // Add extensions to mesh obj.AddMember("extensions", json_extensions, w.mAl); diff --git a/code/AssetLib/glTF/glTFExporter.h b/code/AssetLib/glTF/glTFExporter.h index 415992314..fe7592566 100644 --- a/code/AssetLib/glTF/glTFExporter.h +++ b/code/AssetLib/glTF/glTFExporter.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GLTFEXPORTER_H_INC #define AI_GLTFEXPORTER_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_EXPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_EXPORTER) #include #include diff --git a/code/AssetLib/glTF/glTFImporter.cpp b/code/AssetLib/glTF/glTFImporter.cpp index b4ef9b06f..c106acf21 100644 --- a/code/AssetLib/glTF/glTFImporter.cpp +++ b/code/AssetLib/glTF/glTFImporter.cpp @@ -1,4 +1,4 @@ -/* +/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_IMPORTER) #include "AssetLib/glTF/glTFImporter.h" #include "AssetLib/glTF/glTFAsset.h" @@ -215,8 +215,8 @@ void glTFImporter::ImportMeshes(glTF::Asset &r) { // Check if mesh extensions is used if (mesh.Extension.size() > 0) { - for (Mesh::SExtension *cur_ext : mesh.Extension) { #ifdef ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC + for (Mesh::SExtension *cur_ext : mesh.Extension) { if (cur_ext->Type == Mesh::SExtension::EType::Compression_Open3DGC) { // Limitations for meshes when using Open3DGC-compression. // It's a current limitation of sp... Specification have not this part still - about mesh compression. Why only one primitive? @@ -233,12 +233,12 @@ void glTFImporter::ImportMeshes(glTF::Asset &r) { buf->EncodedRegion_SetCurrent(mesh.id); } else -#endif { throw DeadlyImportError("GLTF: Can not import mesh: unknown mesh extension (code: \"" + to_string(cur_ext->Type) + "\"), only Open3DGC is supported."); } } +#endif } // if(mesh.Extension.size() > 0) meshOffsets.push_back(k); diff --git a/code/AssetLib/glTF2/glTF2Asset.h b/code/AssetLib/glTF2/glTF2Asset.h index 7a167eaed..e45b53006 100644 --- a/code/AssetLib/glTF2/glTF2Asset.h +++ b/code/AssetLib/glTF2/glTF2Asset.h @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef GLTF2ASSET_H_INC #define GLTF2ASSET_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER) #include diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.h b/code/AssetLib/glTF2/glTF2AssetWriter.h index 784ab2ea5..ce58717f3 100644 --- a/code/AssetLib/glTF2/glTF2AssetWriter.h +++ b/code/AssetLib/glTF2/glTF2AssetWriter.h @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef GLTF2ASSETWRITER_H_INC #define GLTF2ASSETWRITER_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER) #include "glTF2Asset.h" diff --git a/code/AssetLib/glTF2/glTF2Exporter.h b/code/AssetLib/glTF2/glTF2Exporter.h index 421a4806e..1d28ed459 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.h +++ b/code/AssetLib/glTF2/glTF2Exporter.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GLTF2EXPORTER_H_INC #define AI_GLTF2EXPORTER_H_INC -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER) #include #include diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 4d740d8c1..323f29f8e 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER) #include "AssetLib/glTF2/glTF2Importer.h" #include "PostProcessing/MakeVerboseFormat.h" diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 9f8f519d9..bb43449e1 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -899,7 +899,7 @@ ENDIF() # utf8 IF(ASSIMP_HUNTER_ENABLED) hunter_add_package(utf8) - find_package(utf8 CONFIG REQUIRED) + find_package(utf8cpp CONFIG REQUIRED) ELSE() # utf8 is header-only, so Assimp doesn't need to do anything. ENDIF() @@ -1159,7 +1159,7 @@ IF(ASSIMP_HUNTER_ENABLED) minizip::minizip ZLIB::zlib RapidJSON::rapidjson - utf8::utf8 + utf8cpp zip::zip ) ELSE() diff --git a/code/Common/BaseImporter.cpp b/code/Common/BaseImporter.cpp index 47ff05f2f..bcea076be 100644 --- a/code/Common/BaseImporter.cpp +++ b/code/Common/BaseImporter.cpp @@ -343,7 +343,7 @@ std::string BaseImporter::GetExtension(const std::string &file) { } #ifdef ASSIMP_USE_HUNTER -#include +#include #else #include "../contrib/utf8cpp/source/utf8.h" #endif diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp index 65edd1bdd..32f47ab07 100644 --- a/code/Common/DefaultIOStream.cpp +++ b/code/Common/DefaultIOStream.cpp @@ -100,7 +100,6 @@ size_t DefaultIOStream::Write(const void *pvBuffer, size_t pCount) { ai_assert(nullptr != pvBuffer); ai_assert(0 != pSize); - ai_assert(0 != pCount); return (mFile ? ::fwrite(pvBuffer, pSize, pCount, mFile) : 0); } diff --git a/code/Common/Exporter.cpp b/code/Common/Exporter.cpp index 77ac4b7a6..031d5c24e 100644 --- a/code/Common/Exporter.cpp +++ b/code/Common/Exporter.cpp @@ -179,11 +179,14 @@ static void setupExporterArray(std::vector &exporte aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices)); #endif -#ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_EXPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_EXPORTER) exporters.push_back(Exporter::ExportFormatEntry("gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); exporters.push_back(Exporter::ExportFormatEntry("glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); +#endif + +#if !defined(ASSIMP_BUILD_NO_GLTF_EXPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_EXPORTER) exporters.push_back(Exporter::ExportFormatEntry("gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); exporters.push_back(Exporter::ExportFormatEntry("glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, diff --git a/code/Common/Importer.cpp b/code/Common/Importer.cpp index a46d39b48..77eb8ef8c 100644 --- a/code/Common/Importer.cpp +++ b/code/Common/Importer.cpp @@ -1174,7 +1174,7 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const { // add all bone anims for (unsigned int a = 0; a < pc->mNumChannels; ++a) { - const aiNodeAnim* pc2 = pc->mChannels[i]; + const aiNodeAnim* pc2 = pc->mChannels[a]; in.animations += sizeof(aiNodeAnim); in.animations += pc2->mNumPositionKeys * sizeof(aiVectorKey); in.animations += pc2->mNumScalingKeys * sizeof(aiVectorKey); diff --git a/code/Common/ImporterRegistry.cpp b/code/Common/ImporterRegistry.cpp index da51696bc..c24f39a31 100644 --- a/code/Common/ImporterRegistry.cpp +++ b/code/Common/ImporterRegistry.cpp @@ -1,4 +1,4 @@ -/* +/* --------------------------------------------------------------------------- Open Asset Import Library (assimp) --------------------------------------------------------------------------- @@ -179,8 +179,10 @@ corresponding preprocessor flag to selectively disable formats. #ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER #include "AssetLib/Assbin/AssbinLoader.h" #endif -#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF1_IMPORTER) #include "AssetLib/glTF/glTFImporter.h" +#endif +#if !defined(ASSIMP_BUILD_NO_GLTF_IMPORTER) && !defined(ASSIMP_BUILD_NO_GLTF2_IMPORTER) #include "AssetLib/glTF2/glTF2Importer.h" #endif #ifndef ASSIMP_BUILD_NO_C4D_IMPORTER @@ -339,8 +341,10 @@ void GetImporterInstanceList(std::vector &out) { #if (!defined ASSIMP_BUILD_NO_ASSBIN_IMPORTER) out.push_back(new AssbinImporter()); #endif -#if (!defined ASSIMP_BUILD_NO_GLTF_IMPORTER) +#if (!defined ASSIMP_BUILD_NO_GLTF_IMPORTER && !defined ASSIMP_BUILD_NO_GLTF1_IMPORTER) out.push_back(new glTFImporter()); +#endif +#if (!defined ASSIMP_BUILD_NO_GLTF_IMPORTER && !defined ASSIMP_BUILD_NO_GLTF2_IMPORTER) out.push_back(new glTF2Importer()); #endif #if (!defined ASSIMP_BUILD_NO_C4D_IMPORTER)