From 6382af2b650f8596b6ad51d31a0d2ec9a835678f Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 1 May 2017 19:09:06 +0200 Subject: [PATCH] Gracefully transform support_material_threshold = 0 into the default value instead of emitting an error. #3837 --- lib/Slic3r/Config.pm | 6 ------ xs/src/libslic3r/PrintConfig.cpp | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 167c733dd..930917dfd 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -269,12 +269,6 @@ sub validate { qw(perimeter infill solid_infill top_infill support_material first_layer); } - # support material - if ($self->support_material) { - die "Value of 0 is illegal. Use some % value instead (e.g. 150%) for auto.\n" - if $self->support_material_threshold =~ /^0+/; - } - # general validation, quick and dirty foreach my $opt_key (@{$self->get_keys}) { diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 8a63ef268..e0771d596 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1705,6 +1705,10 @@ PrintConfigBase::_handle_legacy(t_config_option_key &opt_key, std::string &value values is a dirty hack and will need to be removed sometime in the future, but it will avoid lots of complaints for now. */ value = "0"; + } else if (opt_key == "support_material_threshold" && value == "0") { + // 0 used to be automatic threshold, but we introduced percent values so let's + // transform it into the default value + value = "60%"; } // cemetery of old config settings