Commit 4bc99179 authored by Patrik Huber's avatar Patrik Huber

Fixed wrong filename when storing a textured obj with a relative path (e.g. "./results/out")

parent d75e544c
...@@ -109,7 +109,7 @@ inline void write_textured_obj(Mesh mesh, std::string filename) ...@@ -109,7 +109,7 @@ inline void write_textured_obj(Mesh mesh, std::string filename)
boost::filesystem::path mtl_filename(filename); boost::filesystem::path mtl_filename(filename);
mtl_filename.replace_extension(".mtl"); mtl_filename.replace_extension(".mtl");
obj_file << "mtllib " << mtl_filename.string() << std::endl; // first line of the obj file obj_file << "mtllib " << mtl_filename.filename().string() << std::endl; // first line of the obj file
// same as in write_obj(): // same as in write_obj():
if (mesh.colors.empty()) { if (mesh.colors.empty()) {
...@@ -142,7 +142,7 @@ inline void write_textured_obj(Mesh mesh, std::string filename) ...@@ -142,7 +142,7 @@ inline void write_textured_obj(Mesh mesh, std::string filename)
texture_filename.replace_extension(".isomap.png"); texture_filename.replace_extension(".isomap.png");
mtl_file << "newmtl FaceTexture" << std::endl; mtl_file << "newmtl FaceTexture" << std::endl;
mtl_file << "map_Kd " << texture_filename.string() << std::endl; mtl_file << "map_Kd " << texture_filename.filename().string() << std::endl;
return; return;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment