From 33c1d5a0cf9b1903bd6a8d8ef78bc043e914eb85 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Tue, 16 Jan 2024 09:55:37 +0800 Subject: [PATCH] FIX: [#3375] Force .gcode.3mf file extension github: #3375 Change-Id: Id0a1e8e5c9d6ebaceaac52e31cc64d60c6b266a2 --- src/slic3r/GUI/Plater.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f60d1c89d..9195b5bc3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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"); + } + } } }