|
@@ -60,6 +60,7 @@ Here we implement only the C++ interface (Assimp::Exporter).
|
|
#include "BaseProcess.h"
|
|
#include "BaseProcess.h"
|
|
#include "Importer.h" // need this for GetPostProcessingStepInstanceList()
|
|
#include "Importer.h" // need this for GetPostProcessingStepInstanceList()
|
|
|
|
|
|
|
|
+#include "JoinVerticesProcess.h"
|
|
#include "MakeVerboseFormat.h"
|
|
#include "MakeVerboseFormat.h"
|
|
#include "ConvertToLHProcess.h"
|
|
#include "ConvertToLHProcess.h"
|
|
|
|
|
|
@@ -73,6 +74,7 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
|
|
void ExportSceneCollada(const char*,IOSystem*, const aiScene*);
|
|
void ExportSceneCollada(const char*,IOSystem*, const aiScene*);
|
|
void ExportSceneObj(const char*,IOSystem*, const aiScene*);
|
|
void ExportSceneObj(const char*,IOSystem*, const aiScene*);
|
|
void ExportSceneSTL(const char*,IOSystem*, const aiScene*);
|
|
void ExportSceneSTL(const char*,IOSystem*, const aiScene*);
|
|
|
|
+void ExportSceneSTLBinary(const char*,IOSystem*, const aiScene*);
|
|
void ExportScenePly(const char*,IOSystem*, const aiScene*);
|
|
void ExportScenePly(const char*,IOSystem*, const aiScene*);
|
|
void ExportScene3DS(const char*, IOSystem*, const aiScene*) {}
|
|
void ExportScene3DS(const char*, IOSystem*, const aiScene*) {}
|
|
|
|
|
|
@@ -86,13 +88,16 @@ Exporter::ExportFormatEntry gExporters[] =
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
|
|
#ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
|
|
Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
|
|
Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
|
|
- aiProcess_GenNormals | aiProcess_PreTransformVertices),
|
|
|
|
|
|
+ aiProcess_GenNormals /*| aiProcess_PreTransformVertices */),
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_NO_STL_EXPORTER
|
|
#ifndef ASSIMP_BUILD_NO_STL_EXPORTER
|
|
Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
|
|
Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL,
|
|
aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
|
|
aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
|
|
),
|
|
),
|
|
|
|
+ Exporter::ExportFormatEntry( "stlb", "Stereolithography(binary)", "stlb" , &ExportSceneSTLBinary,
|
|
|
|
+ aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices
|
|
|
|
+ ),
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
|
|
#ifndef ASSIMP_BUILD_NO_PLY_EXPORTER
|
|
@@ -260,6 +265,7 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
|
|
|
|
|
|
// If the input scene is not in verbose format, but there is at least postprocessing step that relies on it,
|
|
// If the input scene is not in verbose format, but there is at least postprocessing step that relies on it,
|
|
// we need to run the MakeVerboseFormat step first.
|
|
// we need to run the MakeVerboseFormat step first.
|
|
|
|
+ bool must_join_again = false;
|
|
if (scenecopy->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
|
|
if (scenecopy->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
|
|
|
|
|
|
bool verbosify = false;
|
|
bool verbosify = false;
|
|
@@ -277,6 +283,10 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
|
|
|
|
|
|
MakeVerboseFormatProcess proc;
|
|
MakeVerboseFormatProcess proc;
|
|
proc.Execute(scenecopy.get());
|
|
proc.Execute(scenecopy.get());
|
|
|
|
+
|
|
|
|
+ if(!(exp.mEnforcePP & aiProcess_JoinIdenticalVertices)) {
|
|
|
|
+ must_join_again = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -321,6 +331,11 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
|
|
privOut->mPPStepsApplied |= pp;
|
|
privOut->mPPStepsApplied |= pp;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(must_join_again) {
|
|
|
|
+ JoinVerticesProcess proc;
|
|
|
|
+ proc.Execute(scenecopy.get());
|
|
|
|
+ }
|
|
|
|
+
|
|
exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get());
|
|
exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get());
|
|
}
|
|
}
|
|
catch (DeadlyExportError& err) {
|
|
catch (DeadlyExportError& err) {
|