mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 22:30:01 +00:00
IfcConvert: Do not use temp file for MTL as it's such a small file. Fixes #55.
This commit is contained in:
@@ -378,12 +378,13 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
GeometrySerializer* serializer;
|
GeometrySerializer* serializer;
|
||||||
if (output_extension == ".obj") {
|
if (output_extension == ".obj") {
|
||||||
const std::string mtl_temp_filename = change_extension(output_filename, "mtl") + TEMP_FILE_EXTENSION;
|
// Do not use temp file for MTL as it's such a small file.
|
||||||
|
const std::string mtl_filename = change_extension(output_filename, "mtl");
|
||||||
if (!use_world_coords) {
|
if (!use_world_coords) {
|
||||||
Logger::Message(Logger::LOG_NOTICE, "Using world coords when writing WaveFront OBJ files");
|
Logger::Message(Logger::LOG_NOTICE, "Using world coords when writing WaveFront OBJ files");
|
||||||
settings.set(IfcGeom::IteratorSettings::USE_WORLD_COORDS, true);
|
settings.set(IfcGeom::IteratorSettings::USE_WORLD_COORDS, true);
|
||||||
}
|
}
|
||||||
serializer = new WaveFrontOBJSerializer(output_temp_filename, mtl_temp_filename, settings);
|
serializer = new WaveFrontOBJSerializer(output_temp_filename, mtl_filename, settings);
|
||||||
#ifdef WITH_OPENCOLLADA
|
#ifdef WITH_OPENCOLLADA
|
||||||
} else if (output_extension == ".dae") {
|
} else if (output_extension == ".dae") {
|
||||||
serializer = new ColladaSerializer(output_temp_filename, settings);
|
serializer = new ColladaSerializer(output_temp_filename, settings);
|
||||||
@@ -521,12 +522,6 @@ int main(int argc, char** argv) {
|
|||||||
Logger::Message(Logger::LOG_ERROR, "Unable to write output file '" + output_filename + "");
|
Logger::Message(Logger::LOG_ERROR, "Unable to write output file '" + output_filename + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output_extension == ".obj") {
|
|
||||||
std::string mtl_filename = change_extension(output_filename, "mtl");
|
|
||||||
std::string mtl_tmp_filename = mtl_filename + TEMP_FILE_EXTENSION;
|
|
||||||
rename_file(mtl_tmp_filename, mtl_filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
write_log();
|
write_log();
|
||||||
|
|
||||||
time(&end);
|
time(&end);
|
||||||
|
|||||||
Reference in New Issue
Block a user