Merge pull request #297 from gjaegy/master

fixed collada import bug + added obj importer '\' newline feature
pull/300/head
Alexander Gessler 2014-06-13 12:56:48 +02:00
commit 69570f675e
2 changed files with 20 additions and 1 deletions

View File

@ -133,6 +133,7 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
mLights.clear();
mCameras.clear();
mTextures.clear();
mAnims.clear();
// parse the input file
ColladaParser parser( pIOHandler, pFile);
@ -904,6 +905,8 @@ void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pPars
pScene->mAnimations = new aiAnimation*[mAnims.size()];
std::copy( mAnims.begin(), mAnims.end(), pScene->mAnimations);
}
mAnims.clear();
}
// ------------------------------------------------------------------------------------------------

View File

@ -139,7 +139,23 @@ void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
{
strModelName = pFile;
}
// process all '\'
std::vector<char> ::iterator iter = m_Buffer.begin();
while (iter != m_Buffer.end())
{
if (*iter == '\\')
{
// remove '\'
iter = m_Buffer.erase(iter);
// remove next character
while (*iter == '\r' || *iter == '\n')
iter = m_Buffer.erase(iter);
}
else
++iter;
}
// parse the file into a temporary representation
ObjFileParser parser(m_Buffer, strModelName, pIOHandler);