Merge pull request #1040 from johnmaf/bugfix/obj-mtllib-parse

Fix OBJ parser mtllib statement parsing bug.
pull/1048/head
Kim Kulling 2016-10-18 17:09:06 +02:00 committed by GitHub
commit 8fd030f23d
1 changed files with 7 additions and 2 deletions

View File

@ -182,9 +182,14 @@ void ObjFileParser::parseFile()
case 'm': // Parse a material library or merging group ('mg')
{
std::string name;
std::string name;
getName(m_DataIt, m_DataItEnd, name);
size_t nextSpace = name.find(" ");
if (nextSpace != std::string::npos)
name = name.substr(0, nextSpace);
getName(m_DataIt, m_DataItEnd, name);
if (name == "mg")
getGroupNumberAndResolution();
else if(name == "mtllib")