From 485497810860ccdf78734a5471e283fee666f0f6 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 11 Nov 2021 22:15:56 +0100 Subject: [PATCH 1/8] Disable m3d for 5.1 - closes https://github.com/assimp/assimp/issues/4126 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e47b5732..e257ee64e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,6 +527,9 @@ ELSE() ADD_DEFINITIONS ( -D'ASSIMP_BUILD_COMPILER="${ASSIMP_BUILD_COMPILER}"' ) ENDIF() +# Disabled for 5.1 +ADD_DEFINITIONS ( -DASSIMP_BUILD_NO_M3D_IMPORTER ) + MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER ) SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL From 4abf37ace600f0743ad55115887fc15340427d51 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 11 Nov 2021 23:22:06 +0100 Subject: [PATCH 2/8] Update CMakeLists.txt --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e257ee64e..63c153df9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW) CMAKE_MINIMUM_REQUIRED( VERSION 3.10 ) +# Disabled importers: m3d for 5.1 +ADD_DEFINITIONS ( -DASSIMP_BUILD_NO_M3D_IMPORTER ) + # Toggles the use of the hunter package manager option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) @@ -527,9 +530,6 @@ ELSE() ADD_DEFINITIONS ( -D'ASSIMP_BUILD_COMPILER="${ASSIMP_BUILD_COMPILER}"' ) ENDIF() -# Disabled for 5.1 -ADD_DEFINITIONS ( -DASSIMP_BUILD_NO_M3D_IMPORTER ) - MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER ) SET ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER OFF CACHE BOOL From 608bccd9cf3a28c55163c10e84aec025293b7ab0 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 12 Nov 2021 09:13:48 +0100 Subject: [PATCH 3/8] Update M3DWrapper.h --- code/AssetLib/M3D/M3DWrapper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/M3D/M3DWrapper.h b/code/AssetLib/M3D/M3DWrapper.h index dcb82a83a..bd2b3b6c6 100644 --- a/code/AssetLib/M3D/M3DWrapper.h +++ b/code/AssetLib/M3D/M3DWrapper.h @@ -47,7 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_M3DWRAPPER_H_INC #define AI_M3DWRAPPER_H_INC -#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER +#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) #include #include @@ -128,5 +129,6 @@ inline m3d_t *M3DWrapper::M3D() const { } // namespace Assimp #endif +#endif // ASSIMP_BUILD_NO_M3D_IMPORTER #endif // AI_M3DWRAPPER_H_INC From ece61c6c6844cd3f11dc3f6070f57a88f36e9e84 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 12 Nov 2021 09:17:32 +0100 Subject: [PATCH 4/8] Update M3DWrapper.cpp --- code/AssetLib/M3D/M3DWrapper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/AssetLib/M3D/M3DWrapper.cpp b/code/AssetLib/M3D/M3DWrapper.cpp index aa122f5b2..f26912892 100644 --- a/code/AssetLib/M3D/M3DWrapper.cpp +++ b/code/AssetLib/M3D/M3DWrapper.cpp @@ -39,8 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ - -#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER +#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER) #include "M3DWrapper.h" @@ -141,10 +141,12 @@ unsigned char *M3DWrapper::Save(int quality, int flags, unsigned int &size) { } void M3DWrapper::ClearSave() { - if (saved_output_) + if (saved_output_) { M3D_FREE(saved_output_); + } saved_output_ = nullptr; } } // namespace Assimp #endif +#endif From f03dcc27c00dee26653e59756049599dda15b815 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 12 Nov 2021 15:39:21 +0100 Subject: [PATCH 5/8] Update M3DExporter.h --- code/AssetLib/M3D/M3DExporter.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/AssetLib/M3D/M3DExporter.h b/code/AssetLib/M3D/M3DExporter.h index 95313baa2..1247114bb 100644 --- a/code/AssetLib/M3D/M3DExporter.h +++ b/code/AssetLib/M3D/M3DExporter.h @@ -46,10 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_M3DEXPORTER_H_INC #define AI_M3DEXPORTER_H_INC +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER #ifndef ASSIMP_BUILD_NO_M3D_EXPORTER #include -//#include #include // StreamWriterLE #include // DeadlyExportError @@ -60,8 +60,7 @@ struct aiNode; struct aiMaterial; struct aiFace; -namespace Assimp -{ +namespace Assimp { class IOSystem; class IOStream; class ExportProperties; @@ -71,8 +70,7 @@ namespace Assimp // --------------------------------------------------------------------- /** Helper class to export a given scene to an M3D file. */ // --------------------------------------------------------------------- - class M3DExporter - { + class M3DExporter { public: /// Constructor for a specific scene to export M3DExporter(const aiScene* pScene, const ExportProperties* pProperties); @@ -89,6 +87,7 @@ namespace Assimp }; } +#endif // #ifndef ASSIMP_BUILD_NO_M3D_IMPORTER #endif // ASSIMP_BUILD_NO_M3D_EXPORTER #endif // AI_M3DEXPORTER_H_INC From 159fadebbf191729b291d8b06ff17dfe38bbcb69 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 12 Nov 2021 17:53:46 +0100 Subject: [PATCH 6/8] Update M3DExporter.cpp --- code/AssetLib/M3D/M3DExporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/M3D/M3DExporter.cpp b/code/AssetLib/M3D/M3DExporter.cpp index fdcf9c321..22cfd5906 100644 --- a/code/AssetLib/M3D/M3DExporter.cpp +++ b/code/AssetLib/M3D/M3DExporter.cpp @@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define M3D_EXPORTER #ifndef ASSIMP_BUILD_NO_M3D_IMPORTER #define M3D_NODUP -#endif + // Header files, standard library. #include // shared_ptr @@ -437,6 +437,6 @@ void M3DExporter::NodeWalk(const M3DWrapper &m3d, const aiNode *pNode, aiMatrix4 } } } // namespace Assimp - +#endif #endif // ASSIMP_BUILD_NO_M3D_EXPORTER #endif // ASSIMP_BUILD_NO_EXPORT From fc0617280eed3fd951e1cd097d5d056fb36823e7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 13 Nov 2021 08:16:34 +0100 Subject: [PATCH 7/8] Disable m3d-export --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63c153df9..091ab2d3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,8 @@ SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW) CMAKE_MINIMUM_REQUIRED( VERSION 3.10 ) # Disabled importers: m3d for 5.1 -ADD_DEFINITIONS ( -DASSIMP_BUILD_NO_M3D_IMPORTER ) - +ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER) +ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER) # Toggles the use of the hunter package manager option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) From f48731622bfa8ed7725465863d10bfde9d71e99c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 13 Nov 2021 08:30:29 +0100 Subject: [PATCH 8/8] Disable m3d tesat --- test/CMakeLists.txt | 5 ++--- test/unit/ImportExport/utMD3Importer.cpp | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 977c734f2..5e573ed7c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -138,7 +138,7 @@ SET( IMPORTERS unit/utColladaImportExport.cpp unit/utCSMImportExport.cpp unit/utB3DImportExport.cpp - unit/utM3DImportExport.cpp + #unit/utM3DImportExport.cpp unit/utMDCImportExport.cpp unit/utAssbinImportExport.cpp unit/ImportExport/utAssjsonImportExport.cpp @@ -149,14 +149,13 @@ SET( IMPORTERS unit/ImportExport/utNFFImportExport.cpp unit/ImportExport/utXGLImportExport.cpp unit/ImportExport/utMD2Importer.cpp - unit/ImportExport/utMD3Importer.cpp + #unit/ImportExport/utMD3Importer.cpp unit/ImportExport/utMD5Importer.cpp unit/ImportExport/utMDLImporter.cpp unit/ImportExport/MDL/MDLHL1TestFiles.h unit/ImportExport/MDL/utMDLImporter_HL1_ImportSettings.cpp unit/ImportExport/MDL/utMDLImporter_HL1_Materials.cpp unit/ImportExport/MDL/utMDLImporter_HL1_Nodes.cpp - #unit/ImportExport/IRR/utIrrImportExport.cpp unit/ImportExport/RAW/utRAWImportExport.cpp unit/ImportExport/Terragen/utTerragenImportExport.cpp ) diff --git a/test/unit/ImportExport/utMD3Importer.cpp b/test/unit/ImportExport/utMD3Importer.cpp index ee15b3271..ab7c41816 100644 --- a/test/unit/ImportExport/utMD3Importer.cpp +++ b/test/unit/ImportExport/utMD3Importer.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + using namespace Assimp; TEST(utMD3Importer, importWatercan) {