Fixed a superflous "Dirty" multi-extruder printer profile after
the introduction of new extruder parameters (deretract_speed extruder_colour retract_before_wipe). https://github.com/prusa3d/Slic3r/issues/325
This commit is contained in:
parent
3e764ada0c
commit
35acd799cf
@ -1841,6 +1841,7 @@ sub get_name {
|
||||
|
||||
package Slic3r::GUI::Tab::Preset;
|
||||
use Moo;
|
||||
use List::Util qw(any);
|
||||
|
||||
# The preset represents a "default" set of properties.
|
||||
has 'default' => (is => 'ro', default => sub { 0 });
|
||||
@ -1866,6 +1867,17 @@ sub config {
|
||||
$config->set($_, $external_config->get($_))
|
||||
for grep $external_config->has($_), @$keys;
|
||||
|
||||
if (any { $_ eq 'nozzle_diameter' } @$keys) {
|
||||
# Loaded the Printer settings. Verify, that all extruder dependent values have enough values.
|
||||
my $nozzle_diameter = $config->nozzle_diameter;
|
||||
my $num_extruders = scalar(@{$nozzle_diameter});
|
||||
foreach my $key (qw(deretract_speed extruder_colour retract_before_wipe)) {
|
||||
my $vec = $config->get($key);
|
||||
push @{$vec}, ($vec->[0]) x ($num_extruders - @{$vec});
|
||||
$config->set($key, $vec);
|
||||
}
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user