auto paint tool - disable when print setup is invalid and show dialog window with error.

This commit is contained in:
PavelMikus 2023-02-16 15:03:04 +01:00
parent db9e6368bd
commit c8a0c2e469

View File

@ -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();