Gracefully transform support_material_threshold = 0 into the default value instead of emitting an error. #3837

This commit is contained in:
Alessandro Ranellucci 2017-05-01 19:09:06 +02:00
parent 1806664686
commit 6382af2b65
2 changed files with 4 additions and 6 deletions

View File

@ -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}) {

View File

@ -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