[Bf-blender-cvs] [8d5101ce1d6] soc-2020-io-performance: MTLWriter: overwrite the file instead of appending to it.

Ankit Meel noreply at git.blender.org
Wed Sep 16 13:05:56 CEST 2020


Commit: 8d5101ce1d6d56772dc63c43e3b860aeaac92ff6
Author: Ankit Meel
Date:   Wed Sep 16 16:30:06 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB8d5101ce1d6d56772dc63c43e3b860aeaac92ff6

MTLWriter: overwrite the file instead of appending to it.

===================================================================

M	source/blender/io/wavefront_obj/intern/obj_export_file_writer.cc

===================================================================

diff --git a/source/blender/io/wavefront_obj/intern/obj_export_file_writer.cc b/source/blender/io/wavefront_obj/intern/obj_export_file_writer.cc
index e5e4603f1cd..c8fbe7aa71f 100644
--- a/source/blender/io/wavefront_obj/intern/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/intern/obj_export_file_writer.cc
@@ -440,7 +440,7 @@ MTLWriter::MTLWriter(const char *obj_filepath)
 {
   BLI_strncpy(mtl_filepath_, obj_filepath, FILE_MAX);
   BLI_path_extension_replace(mtl_filepath_, FILE_MAX, ".mtl");
-  mtl_outfile_ = fopen(mtl_filepath_, "a");
+  mtl_outfile_ = fopen(mtl_filepath_, "w");
   if (!mtl_outfile_) {
     std::perror(std::string("Error in creating the file at: ").append(mtl_filepath_).c_str());
     return;



More information about the Bf-blender-cvs mailing list