Add an extra error check for OBJ model materials (#4402)
This commit is contained in:
parent
9717882563
commit
ce49596014
|
@ -252,7 +252,14 @@ public class OBJModel implements IModel
|
|||
}
|
||||
else if (key.equalsIgnoreCase("usemtl"))
|
||||
{
|
||||
material = this.materialLibrary.materials.get(data);
|
||||
if (this.materialLibrary.materials.containsKey(data))
|
||||
{
|
||||
material = this.materialLibrary.materials.get(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.log.error("OBJModel.Parser: (Model: '{}', Line: {}) material '{}' referenced but was not found", objFrom, lineNum, data);
|
||||
}
|
||||
usemtlCounter++;
|
||||
}
|
||||
else if (key.equalsIgnoreCase("v")) // Vertices: x y z [w] - w Defaults to 1.0
|
||||
|
|
Loading…
Reference in New Issue