diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index a221d4485..72cf456ba 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -697,7 +697,9 @@ void GLGizmoMmuSegmentation::update_model_object() if (updated) { const ModelObjectPtrs &mos = wxGetApp().model().objects; - wxGetApp().obj_list()->update_info_items(std::find(mos.begin(), mos.end(), mo) - mos.begin()); + size_t obj_idx = std::find(mos.begin(), mos.end(), mo) - mos.begin(); + wxGetApp().obj_list()->update_info_items(obj_idx); + wxGetApp().plater()->get_partplate_list().notify_instance_update(obj_idx, 0); m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS)); } } diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 2b4090011..e53644ab8 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -526,8 +526,8 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_ if (evt.CmdDown() && evt.GetKeyCode() == 'J') { m_printhost_queue_dlg->Show(); return; } if (evt.CmdDown() && evt.GetKeyCode() == 'N') { m_plater->new_project(); return;} if (evt.CmdDown() && evt.GetKeyCode() == 'O') { m_plater->load_project(); return;} - if (evt.CmdDown() && evt.ShiftDown() && evt.GetKeyCode() == 'S') { if (m_plater) m_plater->save_project(true); return;} - else if (evt.CmdDown() && evt.GetKeyCode() == 'S') { if (m_plater) m_plater->save_project(); return;} + if (evt.CmdDown() && evt.ShiftDown() && evt.GetKeyCode() == 'S') { if (can_save_as()) m_plater->save_project(true); return;} + else if (evt.CmdDown() && evt.GetKeyCode() == 'S') { if (can_save()) m_plater->save_project(); return;} #ifdef __APPLE__ if (evt.CmdDown() && evt.GetKeyCode() == ',') @@ -1083,13 +1083,13 @@ bool MainFrame::can_save() const { return (m_plater != nullptr) && !m_plater->get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(false) && - m_plater->is_project_dirty(); + m_plater->is_project_dirty() && !m_plater->using_exported_file() && !m_plater->only_gcode_mode(); } bool MainFrame::can_save_as() const { return (m_plater != nullptr) && - !m_plater->get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(false); + !m_plater->get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(false) && !m_plater->using_exported_file() && !m_plater->only_gcode_mode(); } void MainFrame::save_project() @@ -1512,20 +1512,26 @@ bool MainFrame::get_enable_slice_status() BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": on slicing, return false directly!"); return false; } + else if (m_plater->only_gcode_mode() || m_plater->using_exported_file()) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": in gcode/exported 3mf mode, return false directly!"); + return false; + } PartPlateList &part_plate_list = m_plater->get_partplate_list(); PartPlate *current_plate = part_plate_list.get_curr_plate(); if (m_slice_select == eSliceAll) { - if (part_plate_list.is_all_slice_results_valid()) + /*if (part_plate_list.is_all_slice_results_valid()) { enable = false; } else if (!part_plate_list.is_all_plates_ready_for_slice()) { enable = false; - } + }*/ + //always enable slice_all button + enable = true; } else if (m_slice_select == eSlicePlate) { @@ -2150,13 +2156,13 @@ void MainFrame::init_menubar_as_editor() // BBS //publish menu - + if (m_plater) { publishMenu = new wxMenu(); add_common_publish_menu_items(publishMenu, this); publishMenu->AppendSeparator(); } - + // View menu wxMenu* viewMenu = nullptr; if (m_plater) { diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 6be48c5d8..12fcf1ebe 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9068,7 +9068,12 @@ int Plater::export_3mf(const boost::filesystem::path& output_path, SaveStrategy if (!(strategy & SaveStrategy::Backup)) { for (int i = 0; i < p->partplate_list.get_plate_count(); i++) { ThumbnailData* thumbnail_data = &p->partplate_list.get_plate(i)->thumbnail_data; - if (!p->partplate_list.get_plate(i)->thumbnail_data.is_valid()) { + if (p->partplate_list.get_plate(i)->thumbnail_data.is_valid() && using_exported_file()) { + //no need to generate thumbnail + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": non need to re-generate thumbnail for gcode/exported mode of plate %1%")%i; + } + else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": re-generate thumbnail for plate %1%") % i; const ThumbnailsParams thumbnail_params = { {}, false, true, true, true, i }; p->generate_thumbnail(p->partplate_list.get_plate(i)->thumbnail_data, THUMBNAIL_SIZE_3MF.first, THUMBNAIL_SIZE_3MF.second, thumbnail_params, Camera::EType::Ortho); } @@ -9270,6 +9275,14 @@ void Plater::reslice() //BBS: jusdge the result bool result = this->p->restart_background_process(state | priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART); BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", Line %1%: restart background,state=%2%, result=%3%")%__LINE__%state %result; + if ((state & priv::UPDATE_BACKGROUND_PROCESS_INVALID) != 0) + { + //BBS: add logs + BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": state %1% is UPDATE_BACKGROUND_PROCESS_INVALID, can not slice") % state; + p->update_fff_scene_only_shells(); + return; + } + if ((!result) && p->m_slice_all && (p->m_cur_slice_plate < (p->partplate_list.get_plate_count() - 1))) { //slice next @@ -9290,13 +9303,6 @@ void Plater::reslice() this->SetDropTarget(nullptr); } - if ((state & priv::UPDATE_BACKGROUND_PROCESS_INVALID) != 0) - { - //BBS: add logs - BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": state %1% is UPDATE_BACKGROUND_PROCESS_INVALID, can not slice") % state ; - return; - } - bool clean_gcode_toolpaths = true; // BBS if (p->background_process.running())