From c8a0c2e469b21c3c4c030ec09a29f5113fe06b09 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 16 Feb 2023 15:03:04 +0100 Subject: [PATCH] auto paint tool - disable when print setup is invalid and show dialog window with error. --- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index ec993fcd4..9f0d838c3 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -519,6 +519,13 @@ bool GLGizmoFdmSupports::has_backend_supports() void GLGizmoFdmSupports::auto_generate() { + std::string err = wxGetApp().plater()->fff_print().validate(); + if (!err.empty()) { + MessageDialog dlg(GUI::wxGetApp().plater(), _L("Automatic painting requires valid print setup. \n") + err, _L("Warning"), wxOK); + dlg.ShowModal(); + return; + } + ModelObject *mo = m_c->selection_info()->model_object(); 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();