From 323f4faafcb80b8206d4af903fa156980380f6c9 Mon Sep 17 00:00:00 2001 From: Pavel Mikus Date: Tue, 16 May 2023 11:15:43 +0200 Subject: [PATCH] Fix Crash after using automatic support painting, issue #10516 --- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 557cdee8e..7c1a816b9 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -17,6 +17,7 @@ #include +#include namespace Slic3r::GUI { @@ -521,6 +522,13 @@ void GLGizmoFdmSupports::auto_generate() } ModelObject *mo = m_c->selection_info()->model_object(); + bool printable = std::any_of(mo->instances.begin(), mo->instances.end(), [](const ModelInstance *p) { return p->is_printable(); }); + if (!printable) { + MessageDialog dlg(GUI::wxGetApp().plater(), _L("Automatic painting requires printable object."), _L("Warning"), wxOK); + dlg.ShowModal(); + return; + } + bool not_painted = std::all_of(mo->volumes.begin(), mo->volumes.end(), [](const ModelVolume* vol){ return vol->type() != ModelVolumeType::MODEL_PART || vol->supported_facets.empty(); });