Improved obj exporter to export materials to fileName.mtl instead of fileName.obj.mtl

pull/1274/head
Andrej 2017-05-16 15:55:40 +02:00
parent 04dbdca329
commit c3974512e4
1 changed files with 5 additions and 0 deletions

View File

@ -124,6 +124,11 @@ std::string ObjExporter :: GetMaterialLibName()
// ------------------------------------------------------------------------------------------------
std::string ObjExporter :: GetMaterialLibFileName()
{
// Remove existing .obj file extention so that the final material file name will be fileName.mtl and not fileName.obj.mtl
size_t lastdot = filename.find_last_of(".");
if (lastdot != std::string::npos)
filename = filename.substr(0, lastdot);
return filename + MaterialExt;
}