Added support for empty .MTL files.

Some programs such as Silo export an empty .MTL file if you export a
.OBJ that doesn't use any materials. This patch allows the loading of
such files.
This commit is contained in:
rmitton
2015-12-13 22:13:25 -08:00
parent 078dd0c08b
commit b9a4e99607
3 changed files with 23 additions and 11 deletions

View File

@@ -555,9 +555,12 @@ void ObjFileParser::getMaterialLib()
return;
}
// Import material library data from file
// Import material library data from file.
// Some exporters (e.g. Silo) will happily write out empty
// material files if the model doesn't use any materials, so we
// allow that.
std::vector<char> buffer;
BaseImporter::TextFileToBuffer( pFile, buffer );
BaseImporter::TextFileToBuffer( pFile, buffer, BaseImporter::ALLOW_EMPTY );
m_pIO->Close( pFile );
// Importing the material library