|
@@ -122,14 +122,17 @@ std::string ObjExporter :: GetMaterialLibName()
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
-std::string ObjExporter :: GetMaterialLibFileName()
|
|
|
|
-{
|
|
|
|
|
|
+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;
|
|
return filename + MaterialExt;
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
-void ObjExporter :: WriteHeader(std::ostringstream& out)
|
|
|
|
-{
|
|
|
|
|
|
+void ObjExporter :: WriteHeader(std::ostringstream& out) {
|
|
out << "# File produced by Open Asset Import Library (http://www.assimp.sf.net)" << endl;
|
|
out << "# File produced by Open Asset Import Library (http://www.assimp.sf.net)" << endl;
|
|
out << "# (assimp v" << aiGetVersionMajor() << '.' << aiGetVersionMinor() << '.' << aiGetVersionRevision() << ")" << endl << endl;
|
|
out << "# (assimp v" << aiGetVersionMajor() << '.' << aiGetVersionMinor() << '.' << aiGetVersionRevision() << ")" << endl << endl;
|
|
}
|
|
}
|