diff --git a/code/ObjFileParser.cpp b/code/ObjFileParser.cpp index 9b13eea6f..e732eddcd 100644 --- a/code/ObjFileParser.cpp +++ b/code/ObjFileParser.cpp @@ -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")