Merge pull request #76 from assimp/fixes

Fixes
pull/70/merge
Alexander Gessler 2013-08-12 16:36:14 -07:00
commit 9e4776abf7
1 changed files with 12 additions and 1 deletions

View File

@ -60,6 +60,7 @@ Here we implement only the C++ interface (Assimp::Exporter).
#include "BaseProcess.h"
#include "Importer.h" // need this for GetPostProcessingStepInstanceList()
#include "JoinVerticesProcess.h"
#include "MakeVerboseFormat.h"
#include "ConvertToLHProcess.h"
@ -86,7 +87,7 @@ Exporter::ExportFormatEntry gExporters[] =
#ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER
Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj,
aiProcess_GenNormals | aiProcess_PreTransformVertices),
aiProcess_GenNormals /*| aiProcess_PreTransformVertices */),
#endif
#ifndef ASSIMP_BUILD_NO_STL_EXPORTER
@ -260,6 +261,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,
// we need to run the MakeVerboseFormat step first.
bool must_join_again = false;
if (scenecopy->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
bool verbosify = false;
@ -277,6 +279,10 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
MakeVerboseFormatProcess proc;
proc.Execute(scenecopy.get());
if(!(exp.mEnforcePP & aiProcess_JoinIdenticalVertices)) {
must_join_again = true;
}
}
}
@ -321,6 +327,11 @@ aiReturn Exporter :: Export( const aiScene* pScene, const char* pFormatId, const
privOut->mPPStepsApplied |= pp;
}
if(must_join_again) {
JoinVerticesProcess proc;
proc.Execute(scenecopy.get());
}
exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get());
}
catch (DeadlyExportError& err) {