FIX: [#3375] Force .gcode.3mf file extension

github: #3375

Change-Id: Id0a1e8e5c9d6ebaceaac52e31cc64d60c6b266a2
This commit is contained in:
maosheng.wei 2024-01-16 09:55:37 +08:00 committed by Lane.Wei
parent c31f6e5bf3
commit 33c1d5a0cf
1 changed files with 11 additions and 1 deletions

View File

@ -10783,7 +10783,17 @@ void Plater::export_gcode_3mf(bool export_all)
output_path = into_path(dlg.GetPath());
ext = output_path.extension().string();
if (ext != ".3mf")
output_path = output_path.string() + ".3mf";
output_path = output_path.string() + ".gcode.3mf";
else {
std::string path = output_path.string();
path = path.substr(0, path.size() - 4);
if (path.size() < 6)
output_path = output_path.replace_extension(".gcode.3mf");
else {
std::string extension = path.substr(path.size() - 6);
if (extension != ".gcode") output_path = output_path.replace_extension(".gcode.3mf");
}
}
}
}