diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1c5187fb64..1bc535710c 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -136,7 +136,10 @@ void GLCanvas3D::select_bed(int i, bool triggered_by_user) if (wxGetApp().plater()->is_preview_shown()) { s_reload_preview_after_switching_beds = true; wxPostEvent(wxGetApp().plater(), SimpleEvent(EVT_GLVIEWTOOLBAR_PREVIEW)); - wxGetApp().plater()->get_camera().translate_world(s_multiple_beds.get_bed_translation(i) - s_multiple_beds.get_bed_translation(old_bed)); + wxGetApp().plater()->get_camera().translate_world( + s_multiple_beds.get_bed_translation(i) + - s_multiple_beds.get_bed_translation(old_bed) + ); } wxGetApp().plater()->schedule_background_process(); wxGetApp().plater()->object_list_changed(); // Updates Slice Now / Export buttons. diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6902b7a9dd..c22cf93413 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5928,6 +5928,7 @@ struct PrintToExport { std::reference_wrapper print; std::reference_wrapper processor_result; boost::filesystem::path output_path; + std::size_t bed{}; }; void Plater::export_all_gcodes(bool prefer_removable) { @@ -5959,7 +5960,7 @@ void Plater::export_all_gcodes(bool prefer_removable) { + default_output_file.extension().string() }; const fs::path output_file{output_dir / filename}; - prints_to_export.push_back({*print, this->p->gcode_results[print_index], output_file}); + prints_to_export.push_back({*print, this->p->gcode_results[print_index], output_file, print_index}); paths.push_back(output_file); } @@ -5976,14 +5977,17 @@ void Plater::export_all_gcodes(bool prefer_removable) { Print *original_print{&active_fff_print()}; GCodeProcessorResult *original_result{this->p->background_process.get_gcode_result()}; + const int original_bed{s_multiple_beds.get_active_bed()}; ScopeGuard guard{[&](){ this->p->background_process.set_fff_print(original_print); this->p->background_process.set_gcode_result(original_result); + s_multiple_beds.set_active_bed(original_bed); }}; for (const PrintToExport &print_to_export : prints_to_export) { this->p->background_process.set_fff_print(&print_to_export.print.get()); this->p->background_process.set_gcode_result(&print_to_export.processor_result.get()); + this->p->background_process.set_temp_output_path(print_to_export.bed); export_gcode_to_path( print_to_export.output_path, [&](const bool on_removable){ @@ -6573,17 +6577,19 @@ void Plater::connect_gcode_all() { const PrusaConnectNew connect{*print_host_ptr}; Print *original_print{&active_fff_print()}; + const int original_bed{s_multiple_beds.get_active_bed()}; ScopeGuard guard{[&](){ this->p->background_process.set_fff_print(original_print); + s_multiple_beds.set_active_bed(original_bed); }}; - for (std::size_t print_index{0}; print_index < this->get_fff_prints().size(); ++print_index) { const std::unique_ptr &print{this->get_fff_prints()[print_index]}; if (!print || print->empty()) { continue; } this->p->background_process.set_fff_print(print.get()); + this->p->background_process.set_temp_output_path(print_index); PrintHostJob upload_job; upload_job.upload_data = upload_job_template.upload_data;