From 716bba53df8f64ae033d61437a68e8f0c46dde85 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 22 Aug 2026 23:52:11 +0800 Subject: [PATCH] Refuse to slice a broken mixed filament --- src/slic3r/GUI/Plater.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 479b91e098..3b91de019c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -11575,9 +11575,11 @@ void Plater::priv::set_current_panel(wxPanel* panel, bool no_slice) if (current_plate->is_slice_result_valid() && this->model.objects.empty() && !current_has_print_instances) only_has_gcode_need_preview = true; - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": from set_current_panel, no_slice %1%, export_in_progress %2%, model_fits %3%, m_is_slicing %4%")%no_slice%export_in_progress%model_fits%m_is_slicing; + bool mixed_broken = sidebar->has_broken_mixed_filament(); - if (!no_slice && !this->model.objects.empty() && !export_in_progress && model_fits && current_has_print_instances) + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": from set_current_panel, no_slice %1%, export_in_progress %2%, model_fits %3%, m_is_slicing %4%, mixed_broken %5%")%no_slice%export_in_progress%model_fits%m_is_slicing%mixed_broken; + + if (!no_slice && !this->model.objects.empty() && !export_in_progress && model_fits && current_has_print_instances && !mixed_broken) { //if already running in background, not relice here //BBS: add more judge for slicing @@ -18792,6 +18794,15 @@ void Plater::reslice() return; } + // A mixed filament with deleted or type-mismatched components cannot be resolved at slicing + // time. MainFrame::get_enable_slice_status() already disables the Slice button for it, but the + // Preview-tab switch, auto-slice and queued slice events reach reslice() directly, so refuse + // here too instead of letting the engine slice the broken slot as a plain filament. + if (sidebar().has_broken_mixed_filament()) { + BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": broken mixed filament detected, refuse to slice"; + return; + } + // In case SLA gizmo is in editing mode, refuse to continue // and notify user that he should leave it first. if (get_view3D_canvas3D()->get_gizmos_manager().is_in_editing_mode(true))