diff options
Diffstat (limited to 'lib/Slic3r/GUI')
-rw-r--r-- | lib/Slic3r/GUI/MainFrame.pm | 4 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Plater.pm | 31 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm | 6 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm | 4 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Plater/OverrideSettingsPanel.pm | 2 |
5 files changed, 39 insertions, 8 deletions
diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 6baefa545..9d2fd19ce 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -88,7 +88,7 @@ sub new { $self->Fit; $self->SetMinSize([760, 490]); $self->SetSize($self->GetMinSize); - wxTheApp->restore_window_pos($self, "main_frame"); + Slic3r::GUI::restore_window_size($self, "main_frame"); $self->Show; $self->Layout; } @@ -101,7 +101,7 @@ sub new { return; } # save window size - wxTheApp->save_window_pos($self, "main_frame"); + Slic3r::GUI::save_window_size($self, "main_frame"); # Save the slic3r.ini. Usually the ini file is saved from "on idle" callback, # but in rare cases it may not have been called yet. wxTheApp->{app_config}->save; diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index ee2689d16..48b82237f 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -767,6 +767,15 @@ sub load_files { $model->convert_multipart_object(scalar(@$nozzle_dmrs)) if $dialog->ShowModal() == wxID_YES; } + # objects imported from 3mf require a call to center_around_origin to have gizmos working properly and this call + # need to be done after looks_like_multipart_object detection + if ($input_file =~ /.3[mM][fF]$/) + { + foreach my $model_object (@{$model->objects}) { + $model_object->center_around_origin; # also aligns object to Z = 0 + } + } + if ($one_by_one) { push @obj_idx, $self->load_model_objects(@{$model->objects}); } else { @@ -1646,20 +1655,37 @@ sub print_info_box_show { $grid_sizer->AddGrowableCol(1, 1); $grid_sizer->AddGrowableCol(3, 1); $print_info_sizer->Add($grid_sizer, 0, wxEXPAND); + my $is_wipe_tower = $self->{print}->total_wipe_tower_filament > 0; my @info = ( L("Used Filament (m)") - => sprintf("%.2f" , $self->{print}->total_used_filament / 1000), + => $is_wipe_tower ? + sprintf("%.2f (%.2f %s + %.2f %s)" , $self->{print}->total_used_filament / 1000, + ($self->{print}->total_used_filament - $self->{print}->total_wipe_tower_filament) / 1000, + L("objects"), + $self->{print}->total_wipe_tower_filament / 1000, + L("wipe tower")) : + sprintf("%.2f" , $self->{print}->total_used_filament / 1000), + L("Used Filament (mm³)") => sprintf("%.2f" , $self->{print}->total_extruded_volume), L("Used Filament (g)"), => sprintf("%.2f" , $self->{print}->total_weight), L("Cost"), - => sprintf("%.2f" , $self->{print}->total_cost), + => $is_wipe_tower ? + sprintf("%.2f (%.2f %s + %.2f %s)" , $self->{print}->total_cost, + ($self->{print}->total_cost - $self->{print}->total_wipe_tower_cost), + L("objects"), + $self->{print}->total_wipe_tower_cost, + L("wipe tower")) : + sprintf("%.2f" , $self->{print}->total_cost), L("Estimated printing time (normal mode)") => $self->{print}->estimated_normal_print_time, L("Estimated printing time (silent mode)") => $self->{print}->estimated_silent_print_time ); + # if there is a wipe tower, insert number of toolchanges info into the array: + splice (@info, 8, 0, L("Number of tool changes") => sprintf("%.d", $self->{print}->m_wipe_tower_number_of_toolchanges)) if ($is_wipe_tower); + while ( my $label = shift @info) { my $value = shift @info; next if $value eq "N/A"; @@ -1674,6 +1700,7 @@ sub print_info_box_show { $scrolled_window_sizer->Show(2, $show); $scrolled_window_panel->Layout; + $self->Layout; } sub do_print { diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm index 7e9ee05dd..fd02a030f 100644 --- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm +++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm @@ -407,13 +407,17 @@ sub on_btn_load { } foreach my $object (@{$model->objects}) { + $object->center_around_origin; foreach my $volume (@{$object->volumes}) { my $new_volume = $self->{model_object}->add_volume($volume); $new_volume->set_modifier($is_modifier); $new_volume->set_name(basename($input_file)); # apply the same translation we applied to the object - $new_volume->mesh->translate(@{$self->{model_object}->origin_translation}); + my $delta_x = $self->{model_object}->origin_translation->x - $object->origin_translation->x; + my $delta_y = $self->{model_object}->origin_translation->y - $object->origin_translation->y; + my $delta_z = $self->{model_object}->origin_translation->z - $object->origin_translation->z; + $new_volume->mesh->translate($delta_x, $delta_y, $delta_z); # set a default extruder value, since user can't add it manually $new_volume->config->set_ifndef('extruder', 0); diff --git a/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm b/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm index 3befba708..3ccf1d7f8 100644 --- a/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm +++ b/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm @@ -33,7 +33,7 @@ sub new { $self->{layers}->Closing; # save window size - wxTheApp->save_window_pos($self, "object_settings"); + Slic3r::GUI::save_window_size($self, "object_settings"); $self->EndModal(wxID_OK); $self->{parts}->Destroy; @@ -49,7 +49,7 @@ sub new { $self->Layout; - wxTheApp->restore_window_pos($self, "object_settings"); + Slic3r::GUI::restore_window_size($self, "object_settings"); return $self; } diff --git a/lib/Slic3r/GUI/Plater/OverrideSettingsPanel.pm b/lib/Slic3r/GUI/Plater/OverrideSettingsPanel.pm index a64bff393..b085871f0 100644 --- a/lib/Slic3r/GUI/Plater/OverrideSettingsPanel.pm +++ b/lib/Slic3r/GUI/Plater/OverrideSettingsPanel.pm @@ -168,7 +168,7 @@ sub update_optgroup { full_labels => 1, label_font => $Slic3r::GUI::small_font, sidetext_font => $Slic3r::GUI::small_font, - label_width => 120, + label_width => 150, on_change => sub { $self->{on_change}->() if $self->{on_change} }, extra_column => sub { my ($line) = @_; |