mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-07 15:27:42 -07:00
Add support for OrcaSlicer 2.3.1-alpha infill rotation template warning
Implement a check for projects created with OrcaSlicer 2.3.1-alpha to warn users about potential issues with infill rotation template settings. If the infill pattern is not safe to rotate, prompt the user to clear the rotation template settings to avoid print quality issues.
This commit is contained in:
parent
5cee8ed086
commit
1e87666487
1 changed files with 27 additions and 4 deletions
|
|
@ -3851,8 +3851,32 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
// // Is there any modifier or advanced config data?
|
||||
// for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||
// }
|
||||
// }
|
||||
else if (load_config && (file_version > app_version)) {
|
||||
// }
|
||||
// Orca: check if the project is created with OrcaSlicer 2.3.1-alpha and use the sparse infill rotation template for non-safe infill patterns
|
||||
else if ((file_version < app_version) && file_version == Semver("2.3.1-alpha")) {
|
||||
if (!config_loaded.opt_string("sparse_infill_rotate_template").empty()) {
|
||||
const auto _sparse_infill_pattern =
|
||||
config_loaded.option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value;
|
||||
bool is_safe_to_rotate = _sparse_infill_pattern == ipRectilinear || _sparse_infill_pattern == ipLine ||
|
||||
_sparse_infill_pattern == ipZigZag || _sparse_infill_pattern == ipCrossZag ||
|
||||
_sparse_infill_pattern == ipLockedZag;
|
||||
if (!is_safe_to_rotate) {
|
||||
wxString msg_text = _(
|
||||
L("This project was created with an OrcaSlicer 2.3.1-alpha and uses "
|
||||
"infill rotation template settings that may not work properly with your current infill pattern. "
|
||||
"This could result in weak support or print quality issues."));
|
||||
msg_text += "\n\n" +
|
||||
_(L("Would you like OrcaSlicer to automatically fix this by clearing the rotation template settings?"));
|
||||
MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO);
|
||||
dialog.SetButtonLabel(wxID_YES, _L("Yes"));
|
||||
dialog.SetButtonLabel(wxID_NO, _L("No"));
|
||||
if (dialog.ShowModal() == wxID_YES) {
|
||||
config_loaded.opt_string("sparse_infill_rotate_template") = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (load_config && (file_version > app_version)) {
|
||||
if (config_substitutions.unrecogized_keys.size() > 0) {
|
||||
wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, found following unrecognized keys:"),
|
||||
file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
||||
|
|
@ -3883,8 +3907,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
show_info(q, text, _L("Newer 3mf version"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!load_config) {
|
||||
} else if (!load_config) {
|
||||
// reset config except color
|
||||
for (ModelObject *model_object : model.objects) {
|
||||
bool has_extruder = model_object->config.has("extruder");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue