diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index b9471b954..efe804b2f 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -117,7 +117,7 @@ sub _build_line { my ($line, $grid_sizer) = @_; if ($self->extra_column) { - if (defined my $item = $self->extra_column->($line)) { + if (defined (my $item = $self->extra_column->($line))) { $grid_sizer->Add($item, 0, wxALIGN_CENTER_VERTICAL, 0); } else { $grid_sizer->AddSpacer(1); diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm index 46500146a..810607923 100644 --- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm +++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm @@ -199,11 +199,17 @@ sub on_btn_load { my $new_volume = $self->{model_object}->add_volume($volume); $new_volume->modifier($is_modifier); if (!defined $new_volume->material_id) { + # it looks like this block is never entered because all input volumes seem to have an assigned material + # TODO: check we can assume that for any input format my $material_name = basename($input_file); $material_name =~ s/\.(stl|obj)$//i; - $self->{model_object}->model->set_material($material_name); + my $material = $self->{model_object}->model->set_material($material_name); $new_volume->material_id($material_name); } + + # set a default extruder value, since user can't add it manually + my $material = $self->{model_object}->model->materials->{$new_volume->material_id}; + $material->config->set_ifndef('extruder', 1); } } }