From 49ae88583444bec7c930b9db16f028e6584d8f59 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Thu, 1 Jul 2021 09:15:08 +0200 Subject: [PATCH] Correctly convert legacy bool 'draft_shield' to enum --- src/libslic3r/PrintConfig.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d0569ea11..d91770d77 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3666,9 +3666,12 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va value = "rectilinear"; } else if (opt_key == "skirt_height" && value == "-1") { // PrusaSlicer no more accepts skirt_height == -1 to print a draft shield to the top of the highest object. - // A new "draft_shield" boolean config value is used instead. + // A new "draft_shield" enum config value is used instead. opt_key = "draft_shield"; - value = "1"; + value = "enabled"; + } else if (opt_key == "draft_shield" && (value == "1" || value == "0")) { + // draft_shield used to be a bool, it was turned into an enum in PrusaSlicer 2.4.0. + value = value == "1" ? "enabled" : "disabled"; } else if (opt_key == "octoprint_host") { opt_key = "print_host"; } else if (opt_key == "octoprint_cafile") {