summaryrefslogtreecommitdiff
path: root/thirdparty/assimp/code/Common
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/assimp/code/Common')
-rw-r--r--thirdparty/assimp/code/Common/Assimp.cpp2
-rw-r--r--thirdparty/assimp/code/Common/BaseImporter.cpp9
-rw-r--r--thirdparty/assimp/code/Common/BaseProcess.cpp2
-rw-r--r--thirdparty/assimp/code/Common/BaseProcess.h2
-rw-r--r--thirdparty/assimp/code/Common/Bitmap.cpp2
-rw-r--r--thirdparty/assimp/code/Common/CreateAnimMesh.cpp2
-rw-r--r--thirdparty/assimp/code/Common/DefaultIOStream.cpp35
-rw-r--r--thirdparty/assimp/code/Common/DefaultIOSystem.cpp2
-rw-r--r--thirdparty/assimp/code/Common/DefaultLogger.cpp6
-rw-r--r--thirdparty/assimp/code/Common/DefaultProgressHandler.h2
-rw-r--r--thirdparty/assimp/code/Common/Exporter.cpp134
-rw-r--r--thirdparty/assimp/code/Common/FileLogStream.h2
-rw-r--r--thirdparty/assimp/code/Common/FileSystemFilter.h2
-rw-r--r--thirdparty/assimp/code/Common/Importer.cpp292
-rw-r--r--thirdparty/assimp/code/Common/Importer.h2
-rw-r--r--thirdparty/assimp/code/Common/ImporterRegistry.cpp2
-rw-r--r--thirdparty/assimp/code/Common/PolyTools.h2
-rw-r--r--thirdparty/assimp/code/Common/PostStepRegistry.cpp2
-rw-r--r--thirdparty/assimp/code/Common/RemoveComments.cpp2
-rw-r--r--thirdparty/assimp/code/Common/SGSpatialSort.cpp2
-rw-r--r--thirdparty/assimp/code/Common/SceneCombiner.cpp3
-rw-r--r--thirdparty/assimp/code/Common/ScenePreprocessor.cpp11
-rw-r--r--thirdparty/assimp/code/Common/ScenePreprocessor.h2
-rw-r--r--thirdparty/assimp/code/Common/ScenePrivate.h2
-rw-r--r--thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp2
-rw-r--r--thirdparty/assimp/code/Common/SpatialSort.cpp2
-rw-r--r--thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp42
-rw-r--r--thirdparty/assimp/code/Common/SplitByBoneCountProcess.h2
-rw-r--r--thirdparty/assimp/code/Common/StandardShapes.cpp2
-rw-r--r--thirdparty/assimp/code/Common/StdOStreamLogStream.h2
-rw-r--r--thirdparty/assimp/code/Common/Subdivision.cpp2
-rw-r--r--thirdparty/assimp/code/Common/TargetAnimation.cpp2
-rw-r--r--thirdparty/assimp/code/Common/TargetAnimation.h2
-rw-r--r--thirdparty/assimp/code/Common/Version.cpp10
-rw-r--r--thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp6
-rw-r--r--thirdparty/assimp/code/Common/VertexTriangleAdjacency.h2
-rw-r--r--thirdparty/assimp/code/Common/Win32DebugLogStream.h2
-rw-r--r--thirdparty/assimp/code/Common/assbin_chunks.h2
-rw-r--r--thirdparty/assimp/code/Common/material.cpp97
-rw-r--r--thirdparty/assimp/code/Common/scene.cpp2
-rw-r--r--thirdparty/assimp/code/Common/simd.cpp2
-rw-r--r--thirdparty/assimp/code/Common/simd.h2
42 files changed, 248 insertions, 459 deletions
diff --git a/thirdparty/assimp/code/Common/Assimp.cpp b/thirdparty/assimp/code/Common/Assimp.cpp
index 66588f0bc6..178b2c01d0 100644
--- a/thirdparty/assimp/code/Common/Assimp.cpp
+++ b/thirdparty/assimp/code/Common/Assimp.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/BaseImporter.cpp b/thirdparty/assimp/code/Common/BaseImporter.cpp
index 8d7b029baa..5c1e605549 100644
--- a/thirdparty/assimp/code/Common/BaseImporter.cpp
+++ b/thirdparty/assimp/code/Common/BaseImporter.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -191,7 +191,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions) {
}
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
- if (pStream) {
+ if (pStream.get() ) {
// read 200 characters from the file
std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]);
char *buffer( _buffer.get() );
@@ -283,6 +283,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
return "";
}
+
// thanks to Andy Maloney for the hint
std::string ret = file.substr( pos + 1 );
std::transform( ret.begin(), ret.end(), ret.begin(), ToLower<char>);
@@ -308,7 +309,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
};
magic = reinterpret_cast<const char*>(_magic);
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
- if (pStream) {
+ if (pStream.get() ) {
// skip to offset
pStream->Seek(offset,aiOrigin_SET);
@@ -602,7 +603,7 @@ unsigned int BatchLoader::AddLoadRequest(const std::string& file,
}
// no, we don't have it. So add it to the queue ...
- m_data->requests.emplace_back(file, steps, map, m_data->next_id);
+ m_data->requests.push_back(LoadRequest(file,steps,map, m_data->next_id));
return m_data->next_id++;
}
diff --git a/thirdparty/assimp/code/Common/BaseProcess.cpp b/thirdparty/assimp/code/Common/BaseProcess.cpp
index 974af68db0..e247be418d 100644
--- a/thirdparty/assimp/code/Common/BaseProcess.cpp
+++ b/thirdparty/assimp/code/Common/BaseProcess.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/BaseProcess.h b/thirdparty/assimp/code/Common/BaseProcess.h
index a7e48bba36..4d5c7a76be 100644
--- a/thirdparty/assimp/code/Common/BaseProcess.h
+++ b/thirdparty/assimp/code/Common/BaseProcess.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/Bitmap.cpp b/thirdparty/assimp/code/Common/Bitmap.cpp
index 7d82257044..b22b71ea9e 100644
--- a/thirdparty/assimp/code/Common/Bitmap.cpp
+++ b/thirdparty/assimp/code/Common/Bitmap.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/CreateAnimMesh.cpp b/thirdparty/assimp/code/Common/CreateAnimMesh.cpp
index 7317dc45b3..98b60e5319 100644
--- a/thirdparty/assimp/code/Common/CreateAnimMesh.cpp
+++ b/thirdparty/assimp/code/Common/CreateAnimMesh.cpp
@@ -4,7 +4,7 @@ Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (C) 2016 The Qt Company Ltd.
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2012, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/DefaultIOStream.cpp b/thirdparty/assimp/code/Common/DefaultIOStream.cpp
index 205f19e378..1c100b6189 100644
--- a/thirdparty/assimp/code/Common/DefaultIOStream.cpp
+++ b/thirdparty/assimp/code/Common/DefaultIOStream.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -52,35 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace Assimp;
-namespace
-{
- template<size_t sizeOfPointer>
- size_t select_ftell(FILE* file)
- {
- return ::ftell(file);
- }
-
- template<size_t sizeOfPointer>
- int select_fseek(FILE* file, int64_t offset, int origin)
- {
- return ::fseek(file, static_cast<long>(offset), origin);
- }
-
-#if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
- template<>
- size_t select_ftell<8>(FILE* file)
- {
- return ::_ftelli64(file);
- }
-
- template<>
- int select_fseek<8>(FILE* file, int64_t offset, int origin)
- {
- return ::_fseeki64(file, offset, origin);
- }
-#endif
-}
-
// ----------------------------------------------------------------------------------
DefaultIOStream::~DefaultIOStream()
{
@@ -122,7 +93,7 @@ aiReturn DefaultIOStream::Seek(size_t pOffset,
aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET");
// do the seek
- return (0 == select_fseek<sizeof(void*)>(mFile, (int64_t)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE);
+ return (0 == ::fseek(mFile, (long)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE);
}
// ----------------------------------------------------------------------------------
@@ -131,7 +102,7 @@ size_t DefaultIOStream::Tell() const
if (!mFile) {
return 0;
}
- return select_ftell<sizeof(void*)>(mFile);
+ return ::ftell(mFile);
}
// ----------------------------------------------------------------------------------
diff --git a/thirdparty/assimp/code/Common/DefaultIOSystem.cpp b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp
index 0343cb289b..6fdc24dd80 100644
--- a/thirdparty/assimp/code/Common/DefaultIOSystem.cpp
+++ b/thirdparty/assimp/code/Common/DefaultIOSystem.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/DefaultLogger.cpp b/thirdparty/assimp/code/Common/DefaultLogger.cpp
index adb9ba1600..de3528d2b4 100644
--- a/thirdparty/assimp/code/Common/DefaultLogger.cpp
+++ b/thirdparty/assimp/code/Common/DefaultLogger.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -107,7 +107,7 @@ LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
return nullptr;
#endif
- // Platform-independent default streams
+ // Platform-independent default streams
case aiDefaultLogStream_STDERR:
return new StdOStreamLogStream(std::cerr);
case aiDefaultLogStream_STDOUT:
@@ -121,7 +121,7 @@ LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
};
// For compilers without dead code path detection
- return nullptr;
+ return NULL;
}
// ----------------------------------------------------------------------------------
diff --git a/thirdparty/assimp/code/Common/DefaultProgressHandler.h b/thirdparty/assimp/code/Common/DefaultProgressHandler.h
index ebf7f118c0..bd2cce00be 100644
--- a/thirdparty/assimp/code/Common/DefaultProgressHandler.h
+++ b/thirdparty/assimp/code/Common/DefaultProgressHandler.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/Exporter.cpp b/thirdparty/assimp/code/Common/Exporter.cpp
index 9f9a33b58e..4ce1a2bd80 100644
--- a/thirdparty/assimp/code/Common/Exporter.cpp
+++ b/thirdparty/assimp/code/Common/Exporter.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -103,91 +103,100 @@ void ExportSceneFBX(const char*, IOSystem*, const aiScene*, const ExportProperti
void ExportSceneFBXA(const char*, IOSystem*, const aiScene*, const ExportProperties*);
void ExportScene3MF( const char*, IOSystem*, const aiScene*, const ExportProperties* );
void ExportSceneM3D(const char*, IOSystem*, const aiScene*, const ExportProperties*);
-void ExportSceneM3DA(const char*, IOSystem*, const aiScene*, const ExportProperties*);
+void ExportSceneA3D(const char*, IOSystem*, const aiScene*, const ExportProperties*);
void ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*);
-
-static void setupExporterArray(std::vector<Exporter::ExportFormatEntry> &exporters) {
+// ------------------------------------------------------------------------------------------------
+// global array of all export formats which Assimp supports in its current build
+Exporter::ExportFormatEntry gExporters[] =
+{
#ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada));
+ Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada ),
#endif
#ifndef ASSIMP_BUILD_NO_X_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("x", "X Files", "x", &ExportSceneXFile,
- aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs));
+ Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile,
+ aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ),
#endif
#ifndef ASSIMP_BUILD_NO_STEP_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("stp", "Step Files", "stp", &ExportSceneStep, 0));
+ Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */));
- exporters.push_back(Exporter::ExportFormatEntry("objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl,
- aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */));
+ Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
+ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ),
+ Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl,
+ aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ),
#endif
#ifndef ASSIMP_BUILD_NO_STL_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("stl", "Stereolithography", "stl", &ExportSceneSTL,
- aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices));
- exporters.push_back(Exporter::ExportFormatEntry("stlb", "Stereolithography (binary)", "stl", &ExportSceneSTLBinary,
- aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices));
+ Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
+ aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
+ ),
+ Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary,
+ aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
+ ),
#endif
#ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("ply", "Stanford Polygon Library", "ply", &ExportScenePly,
- aiProcess_PreTransformVertices));
- exporters.push_back(Exporter::ExportFormatEntry("plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary,
- aiProcess_PreTransformVertices));
+ Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly,
+ aiProcess_PreTransformVertices
+ ),
+ Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary,
+ aiProcess_PreTransformVertices
+ ),
#endif
#ifndef ASSIMP_BUILD_NO_3DS_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("3ds", "Autodesk 3DS (legacy)", "3ds", &ExportScene3DS,
- aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices));
+ Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS,
+ aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ),
#endif
#ifndef ASSIMP_BUILD_NO_GLTF_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));
- 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,
- aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType));
+ Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2,
+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ),
+ Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2,
+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ),
+ Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF,
+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ),
+ Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB,
+ aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ),
#endif
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("assbin", "Assimp Binary File", "assbin", &ExportSceneAssbin, 0));
+ Exporter::ExportFormatEntry( "assbin", "Assimp Binary File", "assbin" , &ExportSceneAssbin, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("assxml", "Assimp XML Document", "assxml", &ExportSceneAssxml, 0));
+ Exporter::ExportFormatEntry( "assxml", "Assimp XML Document", "assxml" , &ExportSceneAssxml, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_X3D_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("x3d", "Extensible 3D", "x3d", &ExportSceneX3D, 0));
+ Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_FBX_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0));
- exporters.push_back(Exporter::ExportFormatEntry("fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0));
+ Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 ),
+ Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_M3D_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("m3d", "Model 3D (binary)", "m3d", &ExportSceneM3D, 0));
- exporters.push_back(Exporter::ExportFormatEntry("m3da", "Model 3D (ascii)", "a3d", &ExportSceneM3DA, 0));
+ Exporter::ExportFormatEntry( "m3d", "Model 3D (binary)", "m3d", &ExportSceneM3D, 0 ),
+ Exporter::ExportFormatEntry( "a3d", "Model 3D (ascii)", "m3d", &ExportSceneA3D, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_3MF_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0));
+ Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ),
#endif
#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER
- exporters.push_back(Exporter::ExportFormatEntry("assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0));
+ Exporter::ExportFormatEntry( "assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0)
#endif
-}
+};
+
+#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0]))
+
class ExporterPimpl {
public:
@@ -203,7 +212,10 @@ public:
GetPostProcessingStepInstanceList(mPostProcessingSteps);
// grab all built-in exporters
- setupExporterArray(mExporters);
+ if ( 0 != ( ASSIMP_NUM_EXPORTERS ) ) {
+ mExporters.resize( ASSIMP_NUM_EXPORTERS );
+ std::copy( gExporters, gExporters + ASSIMP_NUM_EXPORTERS, mExporters.begin() );
+ }
}
~ExporterPimpl() {
@@ -247,28 +259,24 @@ Exporter :: Exporter()
// ------------------------------------------------------------------------------------------------
Exporter::~Exporter() {
- ai_assert(nullptr != pimpl);
- FreeBlob();
+ FreeBlob();
delete pimpl;
}
// ------------------------------------------------------------------------------------------------
void Exporter::SetIOHandler( IOSystem* pIOHandler) {
- ai_assert(nullptr != pimpl);
- pimpl->mIsDefaultIOHandler = !pIOHandler;
+ pimpl->mIsDefaultIOHandler = !pIOHandler;
pimpl->mIOSystem.reset(pIOHandler);
}
// ------------------------------------------------------------------------------------------------
IOSystem* Exporter::GetIOHandler() const {
- ai_assert(nullptr != pimpl);
- return pimpl->mIOSystem.get();
+ return pimpl->mIOSystem.get();
}
// ------------------------------------------------------------------------------------------------
bool Exporter::IsDefaultIOHandler() const {
- ai_assert(nullptr != pimpl);
- return pimpl->mIsDefaultIOHandler;
+ return pimpl->mIsDefaultIOHandler;
}
// ------------------------------------------------------------------------------------------------
@@ -294,7 +302,6 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) {
// ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId,
unsigned int pPreprocessing, const ExportProperties* pProperties) {
- ai_assert(nullptr != pimpl);
if (pimpl->blob) {
delete pimpl->blob;
pimpl->blob = nullptr;
@@ -319,7 +326,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha
aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath,
unsigned int pPreprocessing, const ExportProperties* pProperties) {
ASSIMP_BEGIN_EXCEPTION_REGION();
- ai_assert(nullptr != pimpl);
+
// when they create scenes from scratch, users will likely create them not in verbose
// format. They will likely not be aware that there is a flag in the scene to indicate
// this, however. To avoid surprises and bug reports, we check for duplicates in
@@ -445,7 +452,8 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c
ExportProperties emptyProperties; // Never pass NULL ExportProperties so Exporters don't have to worry.
ExportProperties* pProp = pProperties ? (ExportProperties*)pProperties : &emptyProperties;
- pProp->SetPropertyBool("bJoinIdenticalVertices", pp & aiProcess_JoinIdenticalVertices);
+ pProp->SetPropertyBool("bJoinIdenticalVertices", must_join_again);
+ exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp);
exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp);
pimpl->mProgressHandler->UpdateFileWrite(4, 4);
@@ -465,13 +473,11 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c
// ------------------------------------------------------------------------------------------------
const char* Exporter::GetErrorString() const {
- ai_assert(nullptr != pimpl);
return pimpl->mError.c_str();
}
// ------------------------------------------------------------------------------------------------
void Exporter::FreeBlob() {
- ai_assert(nullptr != pimpl);
delete pimpl->blob;
pimpl->blob = nullptr;
@@ -480,34 +486,30 @@ void Exporter::FreeBlob() {
// ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter::GetBlob() const {
- ai_assert(nullptr != pimpl);
- return pimpl->blob;
+ return pimpl->blob;
}
// ------------------------------------------------------------------------------------------------
const aiExportDataBlob* Exporter::GetOrphanedBlob() const {
- ai_assert(nullptr != pimpl);
- const aiExportDataBlob *tmp = pimpl->blob;
+ const aiExportDataBlob* tmp = pimpl->blob;
pimpl->blob = nullptr;
return tmp;
}
// ------------------------------------------------------------------------------------------------
size_t Exporter::GetExportFormatCount() const {
- ai_assert(nullptr != pimpl);
return pimpl->mExporters.size();
}
// ------------------------------------------------------------------------------------------------
const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) const {
- ai_assert(nullptr != pimpl);
- if (index >= GetExportFormatCount()) {
+ if (index >= GetExportFormatCount()) {
return nullptr;
}
// Return from static storage if the requested index is built-in.
- if (index < pimpl->mExporters.size()) {
- return &pimpl->mExporters[index].mDescription;
+ if (index < sizeof(gExporters) / sizeof(gExporters[0])) {
+ return &gExporters[index].mDescription;
}
return &pimpl->mExporters[index].mDescription;
@@ -515,8 +517,7 @@ const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) c
// ------------------------------------------------------------------------------------------------
aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) {
- ai_assert(nullptr != pimpl);
- for (const ExportFormatEntry &e : pimpl->mExporters) {
+ for(const ExportFormatEntry& e : pimpl->mExporters) {
if (!strcmp(e.mDescription.id,desc.mDescription.id)) {
return aiReturn_FAILURE;
}
@@ -528,8 +529,7 @@ aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) {
// ------------------------------------------------------------------------------------------------
void Exporter::UnregisterExporter(const char* id) {
- ai_assert(nullptr != pimpl);
- for (std::vector<ExportFormatEntry>::iterator it = pimpl->mExporters.begin();
+ for(std::vector<ExportFormatEntry>::iterator it = pimpl->mExporters.begin();
it != pimpl->mExporters.end(); ++it) {
if (!strcmp((*it).mDescription.id,id)) {
pimpl->mExporters.erase(it);
diff --git a/thirdparty/assimp/code/Common/FileLogStream.h b/thirdparty/assimp/code/Common/FileLogStream.h
index ecff03a7eb..740c503192 100644
--- a/thirdparty/assimp/code/Common/FileLogStream.h
+++ b/thirdparty/assimp/code/Common/FileLogStream.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/FileSystemFilter.h b/thirdparty/assimp/code/Common/FileSystemFilter.h
index 1440cf97d1..9923cdbdd3 100644
--- a/thirdparty/assimp/code/Common/FileSystemFilter.h
+++ b/thirdparty/assimp/code/Common/FileSystemFilter.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2008, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
diff --git a/thirdparty/assimp/code/Common/Importer.cpp b/thirdparty/assimp/code/Common/Importer.cpp
index a59ec98122..91b50859a0 100644
--- a/thirdparty/assimp/code/Common/Importer.cpp
+++ b/thirdparty/assimp/code/Common/Importer.cpp
@@ -3,7 +3,9 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
+
+
All rights reserved.
@@ -76,8 +78,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/TinyFormatter.h>
#include <assimp/Exceptional.h>
#include <assimp/Profiler.h>
-#include <assimp/commonMetaData.h>
-
#include <set>
#include <memory>
#include <cctype>
@@ -119,7 +119,7 @@ void* AllocateFromAssimpHeap::operator new ( size_t num_bytes, const std::nothro
return AllocateFromAssimpHeap::operator new( num_bytes );
}
catch( ... ) {
- return nullptr;
+ return NULL;
}
}
@@ -134,8 +134,9 @@ void* AllocateFromAssimpHeap::operator new[] ( size_t num_bytes) {
void* AllocateFromAssimpHeap::operator new[] ( size_t num_bytes, const std::nothrow_t& ) throw() {
try {
return AllocateFromAssimpHeap::operator new[]( num_bytes );
- } catch( ... ) {
- return nullptr;
+ }
+ catch( ... ) {
+ return NULL;
}
}
@@ -147,7 +148,7 @@ void AllocateFromAssimpHeap::operator delete[] ( void* data) {
// Importer constructor.
Importer::Importer()
: pimpl( new ImporterPimpl ) {
- pimpl->mScene = nullptr;
+ pimpl->mScene = NULL;
pimpl->mErrorString = "";
// Allocate a default IO handler
@@ -173,14 +174,14 @@ Importer::Importer()
// ------------------------------------------------------------------------------------------------
// Destructor of Importer
-Importer::~Importer() {
+Importer::~Importer()
+{
// Delete all import plugins
DeleteImporterInstanceList(pimpl->mImporter);
// Delete all post-processing plug-ins
- for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); ++a ) {
+ for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++)
delete pimpl->mPostProcessingSteps[a];
- }
// Delete the assigned IO and progress handler
delete pimpl->mIOHandler;
@@ -198,9 +199,9 @@ Importer::~Importer() {
// ------------------------------------------------------------------------------------------------
// Register a custom post-processing step
-aiReturn Importer::RegisterPPStep(BaseProcess* pImp) {
- ai_assert( nullptr != pImp );
-
+aiReturn Importer::RegisterPPStep(BaseProcess* pImp)
+{
+ ai_assert(NULL != pImp);
ASSIMP_BEGIN_EXCEPTION_REGION();
pimpl->mPostProcessingSteps.push_back(pImp);
@@ -212,9 +213,9 @@ aiReturn Importer::RegisterPPStep(BaseProcess* pImp) {
// ------------------------------------------------------------------------------------------------
// Register a custom loader plugin
-aiReturn Importer::RegisterLoader(BaseImporter* pImp) {
- ai_assert(nullptr != pImp);
-
+aiReturn Importer::RegisterLoader(BaseImporter* pImp)
+{
+ ai_assert(NULL != pImp);
ASSIMP_BEGIN_EXCEPTION_REGION();
// --------------------------------------------------------------------
@@ -241,13 +242,13 @@ aiReturn Importer::RegisterLoader(BaseImporter* pImp) {
pimpl->mImporter.push_back(pImp);
ASSIMP_LOG_INFO_F("Registering custom importer for these file extensions: ", baked);
ASSIMP_END_EXCEPTION_REGION(aiReturn);
-
return AI_SUCCESS;
}
// ------------------------------------------------------------------------------------------------
// Unregister a custom loader plugin
-aiReturn Importer::UnregisterLoader(BaseImporter* pImp) {
+aiReturn Importer::UnregisterLoader(BaseImporter* pImp)
+{
if(!pImp) {
// unregistering a NULL importer is no problem for us ... really!
return AI_SUCCESS;
@@ -264,13 +265,13 @@ aiReturn Importer::UnregisterLoader(BaseImporter* pImp) {
}
ASSIMP_LOG_WARN("Unable to remove custom importer: I can't find you ...");
ASSIMP_END_EXCEPTION_REGION(aiReturn);
-
return AI_FAILURE;
}
// ------------------------------------------------------------------------------------------------
// Unregister a custom loader plugin
-aiReturn Importer::UnregisterPPStep(BaseProcess* pImp) {
+aiReturn Importer::UnregisterPPStep(BaseProcess* pImp)
+{
if(!pImp) {
// unregistering a NULL ppstep is no problem for us ... really!
return AI_SUCCESS;
@@ -287,22 +288,24 @@ aiReturn Importer::UnregisterPPStep(BaseProcess* pImp) {
}
ASSIMP_LOG_WARN("Unable to remove custom post-processing step: I can't find you ..");
ASSIMP_END_EXCEPTION_REGION(aiReturn);
-
return AI_FAILURE;
}
// ------------------------------------------------------------------------------------------------
// Supplies a custom IO handler to the importer to open and access files.
-void Importer::SetIOHandler( IOSystem* pIOHandler) {
- ai_assert(nullptr != pimpl);
-
+void Importer::SetIOHandler( IOSystem* pIOHandler)
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
// If the new handler is zero, allocate a default IO implementation.
- if (!pIOHandler) {
+ if (!pIOHandler)
+ {
// Release pointer in the possession of the caller
pimpl->mIOHandler = new DefaultIOSystem();
pimpl->mIsDefaultHandler = true;
- } else if (pimpl->mIOHandler != pIOHandler) { // Otherwise register the custom handler
+ }
+ // Otherwise register the custom handler
+ else if (pimpl->mIOHandler != pIOHandler)
+ {
delete pimpl->mIOHandler;
pimpl->mIOHandler = pIOHandler;
pimpl->mIsDefaultHandler = false;
@@ -313,32 +316,29 @@ void Importer::SetIOHandler( IOSystem* pIOHandler) {
// ------------------------------------------------------------------------------------------------
// Get the currently set IO handler
IOSystem* Importer::GetIOHandler() const {
- ai_assert(nullptr != pimpl);
-
return pimpl->mIOHandler;
}
// ------------------------------------------------------------------------------------------------
// Check whether a custom IO handler is currently set
bool Importer::IsDefaultIOHandler() const {
- ai_assert(nullptr != pimpl);
-
return pimpl->mIsDefaultHandler;
}
// ------------------------------------------------------------------------------------------------
// Supplies a custom progress handler to get regular callbacks during importing
void Importer::SetProgressHandler ( ProgressHandler* pHandler ) {
- ai_assert(nullptr != pimpl);
-
ASSIMP_BEGIN_EXCEPTION_REGION();
-
// If the new handler is zero, allocate a default implementation.
- if (!pHandler) {
+ if (!pHandler)
+ {
// Release pointer in the possession of the caller
pimpl->mProgressHandler = new DefaultProgressHandler();
pimpl->mIsDefaultProgressHandler = true;
- } else if (pimpl->mProgressHandler != pHandler) { // Otherwise register the custom handler
+ }
+ // Otherwise register the custom handler
+ else if (pimpl->mProgressHandler != pHandler)
+ {
delete pimpl->mProgressHandler;
pimpl->mProgressHandler = pHandler;
pimpl->mIsDefaultProgressHandler = false;
@@ -349,22 +349,19 @@ void Importer::SetProgressHandler ( ProgressHandler* pHandler ) {
// ------------------------------------------------------------------------------------------------
// Get the currently set progress handler
ProgressHandler* Importer::GetProgressHandler() const {
- ai_assert(nullptr != pimpl);
-
return pimpl->mProgressHandler;
}
// ------------------------------------------------------------------------------------------------
// Check whether a custom progress handler is currently set
bool Importer::IsDefaultProgressHandler() const {
- ai_assert(nullptr != pimpl);
-
return pimpl->mIsDefaultProgressHandler;
}
// ------------------------------------------------------------------------------------------------
// Validate post process step flags
-bool _ValidateFlags(unsigned int pFlags) {
+bool _ValidateFlags(unsigned int pFlags)
+{
if (pFlags & aiProcess_GenSmoothNormals && pFlags & aiProcess_GenNormals) {
ASSIMP_LOG_ERROR("#aiProcess_GenSmoothNormals and #aiProcess_GenNormals are incompatible");
return false;
@@ -378,13 +375,12 @@ bool _ValidateFlags(unsigned int pFlags) {
// ------------------------------------------------------------------------------------------------
// Free the current scene
-void Importer::FreeScene( ) {
- ai_assert(nullptr != pimpl);
-
+void Importer::FreeScene( )
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
delete pimpl->mScene;
- pimpl->mScene = nullptr;
+ pimpl->mScene = NULL;
pimpl->mErrorString = "";
ASSIMP_END_EXCEPTION_REGION(void);
@@ -392,48 +388,44 @@ void Importer::FreeScene( ) {
// ------------------------------------------------------------------------------------------------
// Get the current error string, if any
-const char* Importer::GetErrorString() const {
- ai_assert(nullptr != pimpl);
-
- // Must remain valid as long as ReadFile() or FreeFile() are not called
+const char* Importer::GetErrorString() const
+{
+ /* Must remain valid as long as ReadFile() or FreeFile() are not called */
return pimpl->mErrorString.c_str();
}
// ------------------------------------------------------------------------------------------------
// Enable extra-verbose mode
-void Importer::SetExtraVerbose(bool bDo) {
- ai_assert(nullptr != pimpl);
-
+void Importer::SetExtraVerbose(bool bDo)
+{
pimpl->bExtraVerbose = bDo;
}
// ------------------------------------------------------------------------------------------------
// Get the current scene
-const aiScene* Importer::GetScene() const {
- ai_assert(nullptr != pimpl);
-
+const aiScene* Importer::GetScene() const
+{
return pimpl->mScene;
}
// ------------------------------------------------------------------------------------------------
// Orphan the current scene and return it.
-aiScene* Importer::GetOrphanedScene() {
- ai_assert(nullptr != pimpl);
-
+aiScene* Importer::GetOrphanedScene()
+{
aiScene* s = pimpl->mScene;
ASSIMP_BEGIN_EXCEPTION_REGION();
- pimpl->mScene = nullptr;
+ pimpl->mScene = NULL;
- pimpl->mErrorString = ""; // reset error string
+ pimpl->mErrorString = ""; /* reset error string */
ASSIMP_END_EXCEPTION_REGION(aiScene*);
-
return s;
}
// ------------------------------------------------------------------------------------------------
// Validate post-processing flags
-bool Importer::ValidateFlags(unsigned int pFlags) const {
+bool Importer::ValidateFlags(unsigned int pFlags) const
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
// run basic checks for mutually exclusive flags
if(!_ValidateFlags(pFlags)) {
@@ -475,9 +467,8 @@ bool Importer::ValidateFlags(unsigned int pFlags) const {
const aiScene* Importer::ReadFileFromMemory( const void* pBuffer,
size_t pLength,
unsigned int pFlags,
- const char* pHint /*= ""*/) {
- ai_assert(nullptr != pimpl);
-
+ const char* pHint /*= ""*/)
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
if (!pHint) {
pHint = "";
@@ -485,12 +476,12 @@ const aiScene* Importer::ReadFileFromMemory( const void* pBuffer,
if (!pBuffer || !pLength || strlen(pHint) > MaxLenHint ) {
pimpl->mErrorString = "Invalid parameters passed to ReadFileFromMemory()";
- return nullptr;
+ return NULL;
}
// prevent deletion of the previous IOHandler
IOSystem* io = pimpl->mIOHandler;
- pimpl->mIOHandler = nullptr;
+ pimpl->mIOHandler = NULL;
SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength,io));
@@ -502,13 +493,13 @@ const aiScene* Importer::ReadFileFromMemory( const void* pBuffer,
ReadFile(fbuff,pFlags);
SetIOHandler(io);
- ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING(const aiScene*, pimpl->mErrorString);
+ ASSIMP_END_EXCEPTION_REGION(const aiScene*);
return pimpl->mScene;
}
// ------------------------------------------------------------------------------------------------
-void WriteLogOpening(const std::string& file) {
-
+void WriteLogOpening(const std::string& file)
+{
ASSIMP_LOG_INFO_F("Load ", file);
// print a full version dump. This is nice because we don't
@@ -559,9 +550,8 @@ void WriteLogOpening(const std::string& file) {
// ------------------------------------------------------------------------------------------------
// Reads the given file and returns its contents if successful.
-const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
- ai_assert(nullptr != pimpl);
-
+const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
const std::string pFile(_pFile);
@@ -590,7 +580,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
pimpl->mErrorString = "Unable to open file \"" + pFile + "\".";
ASSIMP_LOG_ERROR(pimpl->mErrorString);
- return nullptr;
+ return NULL;
}
std::unique_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
@@ -599,7 +589,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
}
// Find an worker class which can handle the file
- BaseImporter* imp = nullptr;
+ BaseImporter* imp = NULL;
SetPropertyInteger("importerIndex", -1);
for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {
@@ -627,7 +617,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
if( !imp) {
pimpl->mErrorString = "No suitable reader found for the file format of file \"" + pFile + "\".";
ASSIMP_LOG_ERROR(pimpl->mErrorString);
- return nullptr;
+ return NULL;
}
}
@@ -643,7 +633,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
// Dispatch the reading to the worker class for this format
const aiImporterDesc *desc( imp->GetInfo() );
std::string ext( "unknown" );
- if ( nullptr != desc ) {
+ if ( NULL != desc ) {
ext = desc->mName;
}
ASSIMP_LOG_INFO("Found a matching importer for this file format: " + ext + "." );
@@ -664,20 +654,15 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
// If successful, apply all active post processing steps to the imported data
if( pimpl->mScene) {
- if (!pimpl->mScene->mMetaData || !pimpl->mScene->mMetaData->HasKey(AI_METADATA_SOURCE_FORMAT)) {
- if (!pimpl->mScene->mMetaData) {
- pimpl->mScene->mMetaData = new aiMetadata;
- }
- pimpl->mScene->mMetaData->Add(AI_METADATA_SOURCE_FORMAT, aiString(ext));
- }
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
// The ValidateDS process is an exception. It is executed first, even before ScenePreprocessor is called.
- if (pFlags & aiProcess_ValidateDataStructure) {
+ if (pFlags & aiProcess_ValidateDataStructure)
+ {
ValidateDSProcess ds;
ds.ExecuteOnScene (this);
if (!pimpl->mScene) {
- return nullptr;
+ return NULL;
}
}
#endif // no validation
@@ -710,7 +695,8 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
}
}
#ifdef ASSIMP_CATCH_GLOBAL_EXCEPTIONS
- catch (std::exception &e) {
+ catch (std::exception &e)
+ {
#if (defined _MSC_VER) && (defined _CPPRTTI)
// if we have RTTI get the full name of the exception that occurred
pimpl->mErrorString = std::string(typeid( e ).name()) + ": " + e.what();
@@ -719,26 +705,24 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
#endif
ASSIMP_LOG_ERROR(pimpl->mErrorString);
- delete pimpl->mScene; pimpl->mScene = nullptr;
+ delete pimpl->mScene; pimpl->mScene = NULL;
}
#endif // ! ASSIMP_CATCH_GLOBAL_EXCEPTIONS
// either successful or failure - the pointer expresses it anyways
- ASSIMP_END_EXCEPTION_REGION_WITH_ERROR_STRING(const aiScene*, pimpl->mErrorString);
-
+ ASSIMP_END_EXCEPTION_REGION(const aiScene*);
return pimpl->mScene;
}
// ------------------------------------------------------------------------------------------------
// Apply post-processing to the currently bound scene
-const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
- ai_assert(nullptr != pimpl);
-
+const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags)
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
// Return immediately if no scene is active
if (!pimpl->mScene) {
- return nullptr;
+ return NULL;
}
// If no flags are given, return the current scene with no further action
@@ -753,11 +737,12 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
// The ValidateDS process plays an exceptional role. It isn't contained in the global
// list of post-processing steps, so we need to call it manually.
- if (pFlags & aiProcess_ValidateDataStructure) {
+ if (pFlags & aiProcess_ValidateDataStructure)
+ {
ValidateDSProcess ds;
ds.ExecuteOnScene (this);
if (!pimpl->mScene) {
- return nullptr;
+ return NULL;
}
}
#endif // no validation
@@ -777,9 +762,11 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
std::unique_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
+
BaseProcess* process = pimpl->mPostProcessingSteps[a];
pimpl->mProgressHandler->UpdatePostProcess(static_cast<int>(a), static_cast<int>(pimpl->mPostProcessingSteps.size()) );
if( process->IsActive( pFlags)) {
+
if (profiler) {
profiler->BeginRegion("postprocess");
}
@@ -816,28 +803,24 @@ const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags) {
static_cast<int>(pimpl->mPostProcessingSteps.size()) );
// update private scene flags
- if( pimpl->mScene ) {
+ if( pimpl->mScene )
ScenePriv(pimpl->mScene)->mPPStepsApplied |= pFlags;
- }
// clear any data allocated by post-process steps
pimpl->mPPShared->Clean();
ASSIMP_LOG_INFO("Leaving post processing pipeline");
ASSIMP_END_EXCEPTION_REGION(const aiScene*);
-
return pimpl->mScene;
}
// ------------------------------------------------------------------------------------------------
const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess, bool requestValidation ) {
- ai_assert(nullptr != pimpl);
-
ASSIMP_BEGIN_EXCEPTION_REGION();
// Return immediately if no scene is active
- if ( nullptr == pimpl->mScene ) {
- return nullptr;
+ if ( NULL == pimpl->mScene ) {
+ return NULL;
}
// If no flags are given, return the current scene with no further action
@@ -856,7 +839,7 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
ValidateDSProcess ds;
ds.ExecuteOnScene( this );
if ( !pimpl->mScene ) {
- return nullptr;
+ return NULL;
}
}
#endif // no validation
@@ -907,50 +890,46 @@ const aiScene* Importer::ApplyCustomizedPostProcessing( BaseProcess *rootProcess
// ------------------------------------------------------------------------------------------------
// Helper function to check whether an extension is supported by ASSIMP
-bool Importer::IsExtensionSupported(const char* szExtension) const {
+bool Importer::IsExtensionSupported(const char* szExtension) const
+{
return nullptr != GetImporter(szExtension);
}
// ------------------------------------------------------------------------------------------------
-size_t Importer::GetImporterCount() const {
- ai_assert(nullptr != pimpl);
-
+size_t Importer::GetImporterCount() const
+{
return pimpl->mImporter.size();
}
// ------------------------------------------------------------------------------------------------
-const aiImporterDesc* Importer::GetImporterInfo(size_t index) const {
- ai_assert(nullptr != pimpl);
-
+const aiImporterDesc* Importer::GetImporterInfo(size_t index) const
+{
if (index >= pimpl->mImporter.size()) {
- return nullptr;
+ return NULL;
}
return pimpl->mImporter[index]->GetInfo();
}
// ------------------------------------------------------------------------------------------------
-BaseImporter* Importer::GetImporter (size_t index) const {
- ai_assert(nullptr != pimpl);
-
+BaseImporter* Importer::GetImporter (size_t index) const
+{
if (index >= pimpl->mImporter.size()) {
- return nullptr;
+ return NULL;
}
return pimpl->mImporter[index];
}
// ------------------------------------------------------------------------------------------------
// Find a loader plugin for a given file extension
-BaseImporter* Importer::GetImporter (const char* szExtension) const {
- ai_assert(nullptr != pimpl);
-
+BaseImporter* Importer::GetImporter (const char* szExtension) const
+{
return GetImporter(GetImporterIndex(szExtension));
}
// ------------------------------------------------------------------------------------------------
// Find a loader plugin for a given file extension
size_t Importer::GetImporterIndex (const char* szExtension) const {
- ai_assert(nullptr != pimpl);
ai_assert(nullptr != szExtension);
ASSIMP_BEGIN_EXCEPTION_REGION();
@@ -981,9 +960,8 @@ size_t Importer::GetImporterIndex (const char* szExtension) const {
// ------------------------------------------------------------------------------------------------
// Helper function to build a list of all file extensions supported by ASSIMP
-void Importer::GetExtensionList(aiString& szOut) const {
- ai_assert(nullptr != pimpl);
-
+void Importer::GetExtensionList(aiString& szOut) const
+{
ASSIMP_BEGIN_EXCEPTION_REGION();
std::set<std::string> str;
for (std::vector<BaseImporter*>::const_iterator i = pimpl->mImporter.begin();i != pimpl->mImporter.end();++i) {
@@ -1007,9 +985,8 @@ void Importer::GetExtensionList(aiString& szOut) const {
// ------------------------------------------------------------------------------------------------
// Set a configuration property
-bool Importer::SetPropertyInteger(const char* szName, int iValue) {
- ai_assert(nullptr != pimpl);
-
+bool Importer::SetPropertyInteger(const char* szName, int iValue)
+{
bool existing;
ASSIMP_BEGIN_EXCEPTION_REGION();
existing = SetGenericProperty<int>(pimpl->mIntProperties, szName,iValue);
@@ -1019,9 +996,8 @@ bool Importer::SetPropertyInteger(const char* szName, int iValue) {
// ------------------------------------------------------------------------------------------------
// Set a configuration property
-bool Importer::SetPropertyFloat(const char* szName, ai_real iValue) {
- ai_assert(nullptr != pimpl);
-
+bool Importer::SetPropertyFloat(const char* szName, ai_real iValue)
+{
bool existing;
ASSIMP_BEGIN_EXCEPTION_REGION();
existing = SetGenericProperty<ai_real>(pimpl->mFloatProperties, szName,iValue);
@@ -1031,9 +1007,8 @@ bool Importer::SetPropertyFloat(const char* szName, ai_real iValue) {
// ------------------------------------------------------------------------------------------------
// Set a configuration property
-bool Importer::SetPropertyString(const char* szName, const std::string& value) {
- ai_assert(nullptr != pimpl);
-
+bool Importer::SetPropertyString(const char* szName, const std::string& value)
+{
bool existing;
ASSIMP_BEGIN_EXCEPTION_REGION();
existing = SetGenericProperty<std::string>(pimpl->mStringProperties, szName,value);
@@ -1043,9 +1018,8 @@ bool Importer::SetPropertyString(const char* szName, const std::string& value) {
// ------------------------------------------------------------------------------------------------
// Set a configuration property
-bool Importer::SetPropertyMatrix(const char* szName, const aiMatrix4x4& value) {
- ai_assert(nullptr != pimpl);
-
+bool Importer::SetPropertyMatrix(const char* szName, const aiMatrix4x4& value)
+{
bool existing;
ASSIMP_BEGIN_EXCEPTION_REGION();
existing = SetGenericProperty<aiMatrix4x4>(pimpl->mMatrixProperties, szName,value);
@@ -1055,43 +1029,40 @@ bool Importer::SetPropertyMatrix(const char* szName, const aiMatrix4x4& value) {
// ------------------------------------------------------------------------------------------------
// Get a configuration property
-int Importer::GetPropertyInteger(const char* szName, int iErrorReturn /*= 0xffffffff*/) const {
- ai_assert(nullptr != pimpl);
-
+int Importer::GetPropertyInteger(const char* szName,
+ int iErrorReturn /*= 0xffffffff*/) const
+{
return GetGenericProperty<int>(pimpl->mIntProperties,szName,iErrorReturn);
}
// ------------------------------------------------------------------------------------------------
// Get a configuration property
-ai_real Importer::GetPropertyFloat(const char* szName, ai_real iErrorReturn /*= 10e10*/) const {
- ai_assert(nullptr != pimpl);
-
+ai_real Importer::GetPropertyFloat(const char* szName,
+ ai_real iErrorReturn /*= 10e10*/) const
+{
return GetGenericProperty<ai_real>(pimpl->mFloatProperties,szName,iErrorReturn);
}
// ------------------------------------------------------------------------------------------------
// Get a configuration property
-std::string Importer::GetPropertyString(const char* szName, const std::string& iErrorReturn /*= ""*/) const {
- ai_assert(nullptr != pimpl);
-
+const std::string Importer::GetPropertyString(const char* szName,
+ const std::string& iErrorReturn /*= ""*/) const
+{
return GetGenericProperty<std::string>(pimpl->mStringProperties,szName,iErrorReturn);
}
// ------------------------------------------------------------------------------------------------
// Get a configuration property
-aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName, const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const {
- ai_assert(nullptr != pimpl);
-
+const aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName,
+ const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const
+{
return GetGenericProperty<aiMatrix4x4>(pimpl->mMatrixProperties,szName,iErrorReturn);
}
// ------------------------------------------------------------------------------------------------
// Get the memory requirements of a single node
-inline
-void AddNodeWeight(unsigned int& iScene,const aiNode* pcNode) {
- if ( nullptr == pcNode ) {
- return;
- }
+inline void AddNodeWeight(unsigned int& iScene,const aiNode* pcNode)
+{
iScene += sizeof(aiNode);
iScene += sizeof(unsigned int) * pcNode->mNumMeshes;
iScene += sizeof(void*) * pcNode->mNumChildren;
@@ -1103,20 +1074,21 @@ void AddNodeWeight(unsigned int& iScene,const aiNode* pcNode) {
// ------------------------------------------------------------------------------------------------
// Get the memory requirements of the scene
-void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
- ai_assert(nullptr != pimpl);
-
+void Importer::GetMemoryRequirements(aiMemoryInfo& in) const
+{
in = aiMemoryInfo();
aiScene* mScene = pimpl->mScene;
// return if we have no scene loaded
- if (!mScene)
+ if (!pimpl->mScene)
return;
+
in.total = sizeof(aiScene);
// add all meshes
- for (unsigned int i = 0; i < mScene->mNumMeshes;++i) {
+ for (unsigned int i = 0; i < mScene->mNumMeshes;++i)
+ {
in.meshes += sizeof(aiMesh);
if (mScene->mMeshes[i]->HasPositions()) {
in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices;
@@ -1133,16 +1105,14 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS;++a) {
if (mScene->mMeshes[i]->HasVertexColors(a)) {
in.meshes += sizeof(aiColor4D) * mScene->mMeshes[i]->mNumVertices;
- } else {
- break;
}
+ else break;
}
for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) {
if (mScene->mMeshes[i]->HasTextureCoords(a)) {
in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices;
- } else {
- break;
}
+ else break;
}
if (mScene->mMeshes[i]->HasBones()) {
in.meshes += sizeof(void*) * mScene->mMeshes[i]->mNumBones;
@@ -1161,9 +1131,8 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
in.textures += sizeof(aiTexture);
if (pc->mHeight) {
in.textures += 4 * pc->mHeight * pc->mWidth;
- } else {
- in.textures += pc->mWidth;
}
+ else in.textures += pc->mWidth;
}
in.total += in.textures;
@@ -1201,6 +1170,5 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
in.materials += pc->mProperties[a]->mDataLength;
}
}
-
in.total += in.materials;
}
diff --git a/thirdparty/assimp/code/Common/Importer.h b/thirdparty/assimp/code/Common/Importer.h
index c31f67caa7..a439d99c2f 100644
--- a/thirdparty/assimp/code/Common/Importer.h
+++ b/thirdparty/assimp/code/Common/Importer.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/ImporterRegistry.cpp b/thirdparty/assimp/code/Common/ImporterRegistry.cpp
index 41aa21979a..b9f28f0356 100644
--- a/thirdparty/assimp/code/Common/ImporterRegistry.cpp
+++ b/thirdparty/assimp/code/Common/ImporterRegistry.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/PolyTools.h b/thirdparty/assimp/code/Common/PolyTools.h
index 1b89728777..fbbda0e7d1 100644
--- a/thirdparty/assimp/code/Common/PolyTools.h
+++ b/thirdparty/assimp/code/Common/PolyTools.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/PostStepRegistry.cpp b/thirdparty/assimp/code/Common/PostStepRegistry.cpp
index 21bd2af953..8ff4af0400 100644
--- a/thirdparty/assimp/code/Common/PostStepRegistry.cpp
+++ b/thirdparty/assimp/code/Common/PostStepRegistry.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/RemoveComments.cpp b/thirdparty/assimp/code/Common/RemoveComments.cpp
index f7e735c165..91700a7699 100644
--- a/thirdparty/assimp/code/Common/RemoveComments.cpp
+++ b/thirdparty/assimp/code/Common/RemoveComments.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/SGSpatialSort.cpp b/thirdparty/assimp/code/Common/SGSpatialSort.cpp
index 35ffaae582..120070b0aa 100644
--- a/thirdparty/assimp/code/Common/SGSpatialSort.cpp
+++ b/thirdparty/assimp/code/Common/SGSpatialSort.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/SceneCombiner.cpp b/thirdparty/assimp/code/Common/SceneCombiner.cpp
index 29b6082a87..f7b13cc951 100644
--- a/thirdparty/assimp/code/Common/SceneCombiner.cpp
+++ b/thirdparty/assimp/code/Common/SceneCombiner.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
@@ -1312,6 +1312,7 @@ void SceneCombiner::Copy(aiMetadata** _dest, const aiMetadata* src) {
aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties );
std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys);
+ dest->mValues = new aiMetadataEntry[src->mNumProperties];
for (unsigned int i = 0; i < src->mNumProperties; ++i) {
aiMetadataEntry& in = src->mValues[i];
aiMetadataEntry& out = dest->mValues[i];
diff --git a/thirdparty/assimp/code/Common/ScenePreprocessor.cpp b/thirdparty/assimp/code/Common/ScenePreprocessor.cpp
index 6065905193..432a3d7666 100644
--- a/thirdparty/assimp/code/Common/ScenePreprocessor.cpp
+++ b/thirdparty/assimp/code/Common/ScenePreprocessor.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
@@ -217,7 +217,6 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
// No rotation keys? Generate a dummy track
if (!channel->mNumRotationKeys) {
- ai_assert(!channel->mRotationKeys);
channel->mNumRotationKeys = 1;
channel->mRotationKeys = new aiQuatKey[1];
aiQuatKey& q = channel->mRotationKeys[0];
@@ -226,13 +225,10 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
q.mValue = rotation;
ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy rotation track has been generated");
- } else {
- ai_assert(channel->mRotationKeys);
}
// No scaling keys? Generate a dummy track
if (!channel->mNumScalingKeys) {
- ai_assert(!channel->mScalingKeys);
channel->mNumScalingKeys = 1;
channel->mScalingKeys = new aiVectorKey[1];
aiVectorKey& q = channel->mScalingKeys[0];
@@ -241,13 +237,10 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
q.mValue = scaling;
ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy scaling track has been generated");
- } else {
- ai_assert(channel->mScalingKeys);
}
// No position keys? Generate a dummy track
if (!channel->mNumPositionKeys) {
- ai_assert(!channel->mPositionKeys);
channel->mNumPositionKeys = 1;
channel->mPositionKeys = new aiVectorKey[1];
aiVectorKey& q = channel->mPositionKeys[0];
@@ -256,8 +249,6 @@ void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
q.mValue = position;
ASSIMP_LOG_DEBUG("ScenePreprocessor: Dummy position track has been generated");
- } else {
- ai_assert(channel->mPositionKeys);
}
}
}
diff --git a/thirdparty/assimp/code/Common/ScenePreprocessor.h b/thirdparty/assimp/code/Common/ScenePreprocessor.h
index e059d1c95c..3f4c8d7c3f 100644
--- a/thirdparty/assimp/code/Common/ScenePreprocessor.h
+++ b/thirdparty/assimp/code/Common/ScenePreprocessor.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/ScenePrivate.h b/thirdparty/assimp/code/Common/ScenePrivate.h
index f66f48856b..f336aafc9a 100644
--- a/thirdparty/assimp/code/Common/ScenePrivate.h
+++ b/thirdparty/assimp/code/Common/ScenePrivate.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp b/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp
index 724359f99e..06cfe034e9 100644
--- a/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp
+++ b/thirdparty/assimp/code/Common/SkeletonMeshBuilder.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/SpatialSort.cpp b/thirdparty/assimp/code/Common/SpatialSort.cpp
index 604b086b71..a4f3a4e4b8 100644
--- a/thirdparty/assimp/code/Common/SpatialSort.cpp
+++ b/thirdparty/assimp/code/Common/SpatialSort.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp
index ab7a1fe007..2ef66a9afc 100644
--- a/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp
+++ b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
@@ -51,7 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <limits>
#include <assimp/TinyFormatter.h>
-#include <assimp/Exceptional.h>
using namespace Assimp;
using namespace Assimp::Formatter;
@@ -95,10 +94,7 @@ void SplitByBoneCountProcess::Execute( aiScene* pScene)
bool isNecessary = false;
for( unsigned int a = 0; a < pScene->mNumMeshes; ++a)
if( pScene->mMeshes[a]->mNumBones > mMaxBoneCount )
- {
isNecessary = true;
- break;
- }
if( !isNecessary )
{
@@ -159,9 +155,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
{
// skip if not necessary
if( pMesh->mNumBones <= mMaxBoneCount )
- {
return;
- }
// necessary optimisation: build a list of all affecting bones for each vertex
// TODO: (thom) maybe add a custom allocator here to avoid allocating tens of thousands of small arrays
@@ -171,9 +165,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
{
const aiBone* bone = pMesh->mBones[a];
for( unsigned int b = 0; b < bone->mNumWeights; ++b)
- {
vertexBones[ bone->mWeights[b].mVertexId ].push_back( BoneWeight( a, bone->mWeights[b].mWeight));
- }
}
unsigned int numFacesHandled = 0;
@@ -197,9 +189,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
{
// skip if the face is already stored in a submesh
if( isFaceHandled[a] )
- {
continue;
- }
const aiFace& face = pMesh->mFaces[a];
// check every vertex if its bones would still fit into the current submesh
@@ -211,27 +201,17 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
unsigned int boneIndex = vb[c].first;
// if the bone is already used in this submesh, it's ok
if( isBoneUsed[boneIndex] )
- {
continue;
- }
// if it's not used, yet, we would need to add it. Store its bone index
if( std::find( newBonesAtCurrentFace.begin(), newBonesAtCurrentFace.end(), boneIndex) == newBonesAtCurrentFace.end() )
- {
newBonesAtCurrentFace.push_back( boneIndex);
- }
}
}
- if (newBonesAtCurrentFace.size() > mMaxBoneCount)
- {
- throw DeadlyImportError("SplitByBoneCountProcess: Single face requires more bones than specified max bone count!");
- }
// leave out the face if the new bones required for this face don't fit the bone count limit anymore
if( numBones + newBonesAtCurrentFace.size() > mMaxBoneCount )
- {
continue;
- }
// mark all new bones as necessary
while( !newBonesAtCurrentFace.empty() )
@@ -239,9 +219,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
unsigned int newIndex = newBonesAtCurrentFace.back();
newBonesAtCurrentFace.pop_back(); // this also avoids the deallocation which comes with a clear()
if( isBoneUsed[newIndex] )
- {
continue;
- }
isBoneUsed[newIndex] = true;
numBones++;
@@ -259,9 +237,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
// create a new mesh to hold this subset of the source mesh
aiMesh* newMesh = new aiMesh;
if( pMesh->mName.length > 0 )
- {
newMesh->mName.Set( format() << pMesh->mName.data << "_sub" << poNewMeshes.size());
- }
newMesh->mMaterialIndex = pMesh->mMaterialIndex;
newMesh->mPrimitiveTypes = pMesh->mPrimitiveTypes;
poNewMeshes.push_back( newMesh);
@@ -271,9 +247,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
newMesh->mNumFaces = static_cast<unsigned int>(subMeshFaces.size());
newMesh->mVertices = new aiVector3D[newMesh->mNumVertices];
if( pMesh->HasNormals() )
- {
newMesh->mNormals = new aiVector3D[newMesh->mNumVertices];
- }
if( pMesh->HasTangentsAndBitangents() )
{
newMesh->mTangents = new aiVector3D[newMesh->mNumVertices];
@@ -282,17 +256,13 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a )
{
if( pMesh->HasTextureCoords( a) )
- {
newMesh->mTextureCoords[a] = new aiVector3D[newMesh->mNumVertices];
- }
newMesh->mNumUVComponents[a] = pMesh->mNumUVComponents[a];
}
for( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a )
{
if( pMesh->HasVertexColors( a) )
- {
newMesh->mColors[a] = new aiColor4D[newMesh->mNumVertices];
- }
}
// and copy over the data, generating faces with linear indices along the way
@@ -315,9 +285,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
newMesh->mVertices[nvi] = pMesh->mVertices[srcIndex];
if( pMesh->HasNormals() )
- {
newMesh->mNormals[nvi] = pMesh->mNormals[srcIndex];
- }
if( pMesh->HasTangentsAndBitangents() )
{
newMesh->mTangents[nvi] = pMesh->mTangents[srcIndex];
@@ -326,16 +294,12 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
for( unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++c )
{
if( pMesh->HasTextureCoords( c) )
- {
newMesh->mTextureCoords[c][nvi] = pMesh->mTextureCoords[c][srcIndex];
- }
}
for( unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS; ++c )
{
if( pMesh->HasVertexColors( c) )
- {
newMesh->mColors[c][nvi] = pMesh->mColors[c][srcIndex];
- }
}
nvi++;
@@ -352,9 +316,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
for( unsigned int a = 0; a < pMesh->mNumBones; ++a )
{
if( !isBoneUsed[a] )
- {
continue;
- }
// create the new bone
const aiBone* srcBone = pMesh->mBones[a];
@@ -378,9 +340,7 @@ void SplitByBoneCountProcess::SplitMesh( const aiMesh* pMesh, std::vector<aiMesh
{
unsigned int newBoneIndex = mappedBoneIndex[ bonesOnThisVertex[b].first ];
if( newBoneIndex != std::numeric_limits<unsigned int>::max() )
- {
newMesh->mBones[newBoneIndex]->mNumWeights++;
- }
}
}
diff --git a/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h
index 7185d03300..6c904a9df4 100644
--- a/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h
+++ b/thirdparty/assimp/code/Common/SplitByBoneCountProcess.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/StandardShapes.cpp b/thirdparty/assimp/code/Common/StandardShapes.cpp
index d474c61290..2e5100130f 100644
--- a/thirdparty/assimp/code/Common/StandardShapes.cpp
+++ b/thirdparty/assimp/code/Common/StandardShapes.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/StdOStreamLogStream.h b/thirdparty/assimp/code/Common/StdOStreamLogStream.h
index 4f5999775a..893e261a2b 100644
--- a/thirdparty/assimp/code/Common/StdOStreamLogStream.h
+++ b/thirdparty/assimp/code/Common/StdOStreamLogStream.h
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/Subdivision.cpp b/thirdparty/assimp/code/Common/Subdivision.cpp
index 08408f867a..60c54939f5 100644
--- a/thirdparty/assimp/code/Common/Subdivision.cpp
+++ b/thirdparty/assimp/code/Common/Subdivision.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/TargetAnimation.cpp b/thirdparty/assimp/code/Common/TargetAnimation.cpp
index 3c61d21769..b8062499ff 100644
--- a/thirdparty/assimp/code/Common/TargetAnimation.cpp
+++ b/thirdparty/assimp/code/Common/TargetAnimation.cpp
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/TargetAnimation.h b/thirdparty/assimp/code/Common/TargetAnimation.h
index 5b9c1881de..91634ab5aa 100644
--- a/thirdparty/assimp/code/Common/TargetAnimation.h
+++ b/thirdparty/assimp/code/Common/TargetAnimation.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/Version.cpp b/thirdparty/assimp/code/Common/Version.cpp
index f04d122333..cf1da7d5ba 100644
--- a/thirdparty/assimp/code/Common/Version.cpp
+++ b/thirdparty/assimp/code/Common/Version.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
@@ -55,7 +55,7 @@ static const char* LEGAL_INFORMATION =
"Open Asset Import Library (Assimp).\n"
"A free C/C++ library to import various 3D file formats into applications\n\n"
-"(c) 2006-2020, assimp team\n"
+"(c) 2006-2019, assimp team\n"
"License under the terms and conditions of the 3-clause BSD license\n"
"http://assimp.org\n"
;
@@ -67,12 +67,6 @@ ASSIMP_API const char* aiGetLegalString () {
}
// ------------------------------------------------------------------------------------------------
-// Get Assimp patch version
-ASSIMP_API unsigned int aiGetVersionPatch() {
- return VER_PATCH;
-}
-
-// ------------------------------------------------------------------------------------------------
// Get Assimp minor version
ASSIMP_API unsigned int aiGetVersionMinor () {
return VER_MINOR;
diff --git a/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp
index e588dc2a4b..7cfd1a3505 100644
--- a/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp
+++ b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -58,7 +58,7 @@ VertexTriangleAdjacency::VertexTriangleAdjacency(aiFace *pcFaces,
{
// compute the number of referenced vertices if it wasn't specified by the caller
const aiFace* const pcFaceEnd = pcFaces + iNumFaces;
- if (0 == iNumVertices) {
+ if (!iNumVertices) {
for (aiFace* pcFace = pcFaces; pcFace != pcFaceEnd; ++pcFace) {
ai_assert( nullptr != pcFace );
ai_assert(3 == pcFace->mNumIndices);
@@ -68,7 +68,7 @@ VertexTriangleAdjacency::VertexTriangleAdjacency(aiFace *pcFaces,
}
}
- mNumVertices = iNumVertices + 1;
+ mNumVertices = iNumVertices;
unsigned int* pi;
diff --git a/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h
index 2226fc1c42..f3be47612d 100644
--- a/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h
+++ b/thirdparty/assimp/code/Common/VertexTriangleAdjacency.h
@@ -2,7 +2,7 @@
Open Asset Import Library (assimp)
----------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
All rights reserved.
diff --git a/thirdparty/assimp/code/Common/Win32DebugLogStream.h b/thirdparty/assimp/code/Common/Win32DebugLogStream.h
index 3a9d89c73c..a6063a261e 100644
--- a/thirdparty/assimp/code/Common/Win32DebugLogStream.h
+++ b/thirdparty/assimp/code/Common/Win32DebugLogStream.h
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/assbin_chunks.h b/thirdparty/assimp/code/Common/assbin_chunks.h
index 822df5198e..15e4af5e7d 100644
--- a/thirdparty/assimp/code/Common/assbin_chunks.h
+++ b/thirdparty/assimp/code/Common/assbin_chunks.h
@@ -37,7 +37,7 @@ The ASSBIN file format is composed of chunks to represent the hierarchical aiSce
This makes the format extensible and allows backward-compatibility with future data structure
versions. The <tt>&lt;root&gt;/code/assbin_chunks.h</tt> header contains some magic constants
for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found
-in <tt>&lt;root&gt;/tools/assimp_cmd/WriteDump.cpp</tt> (yes, the 'b' is no typo ...).
+in <tt>&lt;root&gt;/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo ...).
@verbatim
diff --git a/thirdparty/assimp/code/Common/material.cpp b/thirdparty/assimp/code/Common/material.cpp
deleted file mode 100644
index f4a29dacfc..0000000000
--- a/thirdparty/assimp/code/Common/material.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Open Asset Import Library (assimp)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2020, assimp team
-
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the assimp team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the assimp team.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------------------------
-*/
-
-/// @file material.cpp
-/** Implement common material related functions. */
-
-#include <assimp/ai_assert.h>
-#include <assimp/material.h>
-
-// -------------------------------------------------------------------------------
-const char* TextureTypeToString(aiTextureType in)
-{
- switch (in)
- {
- case aiTextureType_NONE:
- return "n/a";
- case aiTextureType_DIFFUSE:
- return "Diffuse";
- case aiTextureType_SPECULAR:
- return "Specular";
- case aiTextureType_AMBIENT:
- return "Ambient";
- case aiTextureType_EMISSIVE:
- return "Emissive";
- case aiTextureType_OPACITY:
- return "Opacity";
- case aiTextureType_NORMALS:
- return "Normals";
- case aiTextureType_HEIGHT:
- return "Height";
- case aiTextureType_SHININESS:
- return "Shininess";
- case aiTextureType_DISPLACEMENT:
- return "Displacement";
- case aiTextureType_LIGHTMAP:
- return "Lightmap";
- case aiTextureType_REFLECTION:
- return "Reflection";
- case aiTextureType_BASE_COLOR:
- return "BaseColor";
- case aiTextureType_NORMAL_CAMERA:
- return "NormalCamera";
- case aiTextureType_EMISSION_COLOR:
- return "EmissionColor";
- case aiTextureType_METALNESS:
- return "Metalness";
- case aiTextureType_DIFFUSE_ROUGHNESS:
- return "DiffuseRoughness";
- case aiTextureType_AMBIENT_OCCLUSION:
- return "AmbientOcclusion";
- case aiTextureType_UNKNOWN:
- return "Unknown";
- default:
- break;
- }
- ai_assert(false);
- return "BUG";
-}
diff --git a/thirdparty/assimp/code/Common/scene.cpp b/thirdparty/assimp/code/Common/scene.cpp
index f56562b1ca..d15619acff 100644
--- a/thirdparty/assimp/code/Common/scene.cpp
+++ b/thirdparty/assimp/code/Common/scene.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/simd.cpp b/thirdparty/assimp/code/Common/simd.cpp
index 3054459703..04615f408e 100644
--- a/thirdparty/assimp/code/Common/simd.cpp
+++ b/thirdparty/assimp/code/Common/simd.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
diff --git a/thirdparty/assimp/code/Common/simd.h b/thirdparty/assimp/code/Common/simd.h
index 17856fe720..3eecdd4581 100644
--- a/thirdparty/assimp/code/Common/simd.h
+++ b/thirdparty/assimp/code/Common/simd.h
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team