error loading object file when "usemtl" references an undefined material
This commit is contained in:
parent
e6b8c17345
commit
e4dc0f4d36
6
WFObj.cc
6
WFObj.cc
@ -462,6 +462,12 @@ bool WFObj::buildVBO()
|
|||||||
it != m_faces.end();
|
it != m_faces.end();
|
||||||
it++)
|
it++)
|
||||||
{
|
{
|
||||||
|
if (m_materials.find(it->first) == m_materials.end())
|
||||||
|
{
|
||||||
|
cerr << "Material '" << it->first << "' referenced in '"
|
||||||
|
<< m_path << "' is not defined." << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (vector<Face>::iterator fit = it->second.begin();
|
for (vector<Face>::iterator fit = it->second.begin();
|
||||||
fit != it->second.end();
|
fit != it->second.end();
|
||||||
fit++)
|
fit++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user