Add a notification when custom support enforcers are not used due to supports being off

It is now emitted from Print::validate and has a hyperlink to enable supports
This commit is contained in:
Lukas Matena 2021-02-26 08:23:37 +01:00
parent a7255235e5
commit abd5a9a46e
10 changed files with 89 additions and 11 deletions

View file

@ -430,6 +430,24 @@ void PrintObject::generate_support_material()
if (layer->empty())
throw Slic3r::SlicingError("Levitating objects cannot be printed without supports.");
#endif
// Do we have custom support data that would not be used?
// Notify the user in that case.
if (! this->has_support()) {
for (const ModelVolume* mv : this->model_object()->volumes) {
bool has_enforcers = mv->is_support_enforcer()
|| (mv->is_model_part()
&& ! mv->supported_facets.empty()
&& ! mv->supported_facets.get_facets(*mv, EnforcerBlockerType::ENFORCER).indices.empty());
if (has_enforcers) {
this->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL,
L("An object has custom support enforcers which will not be used "
"because supports are off. Consider turning them on.") + "\n" +
(L("Object name")) + ": " + this->model_object()->name);
break;
}
}
}
}
this->set_done(posSupportMaterial);
}