diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 6584cd2d8..a59fa7e31 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -649,6 +649,7 @@ sub load_file { my $model = eval { Slic3r::Model->read_from_file($input_file) }; Slic3r::GUI::show_error($self, $@) if $@; + my @obj_idx = (); if (defined $model) { if ($model->looks_like_multipart_object) { my $dialog = Wx::MessageDialog->new($self, @@ -660,11 +661,13 @@ sub load_file { $model->convert_multipart_object; } } - $self->load_model_objects(@{$model->objects}); + @obj_idx = $self->load_model_objects(@{$model->objects}); $self->statusbar->SetStatusText("Loaded " . basename($input_file)); } $process_dialog->Destroy; + + return @obj_idx; } sub load_model_objects { @@ -744,6 +747,8 @@ sub load_model_objects { $self->object_list_changed; $self->schedule_background_process; + + return @obj_idx; } sub bed_centerf { @@ -2048,6 +2053,9 @@ sub object_menu { $self->object_settings_dialog; }, undef, 'cog.png'); $menu->AppendSeparator(); + $frame->_append_menu_item($menu, "Reload from Disk", 'Reload the selected file from Disk', sub { + $self->reload_from_disk; + }, undef, 'arrow_refresh.png'); $frame->_append_menu_item($menu, "Export object as STL…", 'Export this single object as STL file', sub { $self->export_object_stl; }, undef, 'brick_go.png'); diff --git a/var/arrow_refresh.png b/var/arrow_refresh.png new file mode 100755 index 000000000..0de26566d Binary files /dev/null and b/var/arrow_refresh.png differ diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp index 92b667a5f..920da5d36 100644 --- a/xs/src/libslic3r/Model.cpp +++ b/xs/src/libslic3r/Model.cpp @@ -662,6 +662,8 @@ ModelObject::cut(coordf_t z, Model* model) const ModelObject* lower = model->add_object(*this); upper->clear_volumes(); lower->clear_volumes(); + upper->input_file = ""; + lower->input_file = ""; for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) { ModelVolume* volume = *v; @@ -711,6 +713,7 @@ ModelObject::split(ModelObjectPtrs* new_objects) (*mesh)->repair(); ModelObject* new_object = this->model->add_object(*this, false); + new_object->input_file = ""; ModelVolume* new_volume = new_object->add_volume(**mesh); new_volume->name = volume->name; new_volume->config = volume->config;