mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-19 12:47:50 -06:00
Fix an issue when loading older 3mf project
This commit is contained in:
parent
793a753cfc
commit
67de85ba43
2 changed files with 66 additions and 64 deletions
|
@ -1716,18 +1716,18 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
||||||
project->project_country_code = m_contry_code;
|
project->project_country_code = m_contry_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: version check
|
// Orca: skip version check
|
||||||
bool dont_load_config = !m_load_config;
|
bool dont_load_config = !m_load_config;
|
||||||
if (m_bambuslicer_generator_version) {
|
// if (m_bambuslicer_generator_version) {
|
||||||
Semver app_version = *(Semver::parse(SoftFever_VERSION));
|
// Semver app_version = *(Semver::parse(SoftFever_VERSION));
|
||||||
Semver file_version = *m_bambuslicer_generator_version;
|
// Semver file_version = *m_bambuslicer_generator_version;
|
||||||
if (file_version.maj() != app_version.maj())
|
// if (file_version.maj() != app_version.maj())
|
||||||
dont_load_config = true;
|
// dont_load_config = true;
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
m_bambuslicer_generator_version = Semver::parse("0.0.0.0");
|
// m_bambuslicer_generator_version = Semver::parse("0.0.0.0");
|
||||||
dont_load_config = true;
|
// dont_load_config = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// we then loop again the entries to read other files stored in the archive
|
// we then loop again the entries to read other files stored in the archive
|
||||||
for (mz_uint i = 0; i < num_entries; ++i) {
|
for (mz_uint i = 0; i < num_entries; ++i) {
|
||||||
|
|
|
@ -3494,62 +3494,64 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
if(load_type != LoadType::LoadGeometry)
|
if(load_type != LoadType::LoadGeometry)
|
||||||
show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
||||||
}
|
}
|
||||||
else if (load_config && (file_version.maj() != app_version.maj())) {
|
// else if (load_config && (file_version.maj() != app_version.maj())) {
|
||||||
// version mismatch, only load geometries
|
// // version mismatch, only load geometries
|
||||||
load_config = false;
|
// load_config = false;
|
||||||
if (!load_model) {
|
// if (!load_model) {
|
||||||
// only load config case, return directly
|
// // only load config case, return directly
|
||||||
show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
// show_info(q, _L("The Config can not be loaded."), _L("Load 3mf"));
|
||||||
q->skip_thumbnail_invalid = false;
|
// q->skip_thumbnail_invalid = false;
|
||||||
return empty_result;
|
// return empty_result;
|
||||||
}
|
// }
|
||||||
load_old_project = true;
|
// load_old_project = true;
|
||||||
// select view to 3D
|
// // select view to 3D
|
||||||
q->select_view_3D("3D");
|
// q->select_view_3D("3D");
|
||||||
// select plate 0 as default
|
// // select plate 0 as default
|
||||||
q->select_plate(0);
|
// q->select_plate(0);
|
||||||
if (load_type != LoadType::LoadGeometry) {
|
// if (load_type != LoadType::LoadGeometry) {
|
||||||
if (en_3mf_file_type == En3mfType::From_BBS)
|
// if (en_3mf_file_type == En3mfType::From_BBS)
|
||||||
show_info(q, _L("The 3mf is generated by old Orca Slicer, load geometry data only."), _L("Load 3mf"));
|
// show_info(q, _L("The 3mf is generated by old Orca Slicer, load geometry data only."), _L("Load 3mf"));
|
||||||
else
|
// else
|
||||||
show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
// show_info(q, _L("The 3mf is not supported by OrcaSlicer, load geometry data only."), _L("Load 3mf"));
|
||||||
}
|
// }
|
||||||
for (ModelObject *model_object : model.objects) {
|
// for (ModelObject *model_object : model.objects) {
|
||||||
model_object->config.reset();
|
// model_object->config.reset();
|
||||||
// Is there any modifier or advanced config data?
|
// // Is there any modifier or advanced config data?
|
||||||
for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
// for (ModelVolume *model_volume : model_object->volumes) model_volume->config.reset();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// else if (load_config && (file_version > app_version)) {
|
else if (load_config && (file_version > app_version)) {
|
||||||
// if (config_substitutions.unrecogized_keys.size() > 0) {
|
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 keys unrecognized:"),
|
wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Found following keys unrecognized:"),
|
||||||
// file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
||||||
// text += "\n";
|
text += "\n";
|
||||||
// bool first = true;
|
bool first = true;
|
||||||
// // std::string context = into_u8(text);
|
// std::string context = into_u8(text);
|
||||||
// wxString context = text;
|
wxString context = text;
|
||||||
|
// if (wxGetApp().app_config->get("user_mode") == "develop") {
|
||||||
// for (auto &key : config_substitutions.unrecogized_keys) {
|
// for (auto &key : config_substitutions.unrecogized_keys) {
|
||||||
// context += " -";
|
// context += " -";
|
||||||
// context += key;
|
// context += key;
|
||||||
// context += ";\n";
|
// context += ";\n";
|
||||||
// first = false;
|
// first = false;
|
||||||
// }
|
// }
|
||||||
// wxString append = _L("You'd better upgrade your software.\n");
|
|
||||||
// context += "\n\n";
|
|
||||||
// // context += into_u8(append);
|
|
||||||
// context += append;
|
|
||||||
// show_info(q, context, _L("Newer 3mf version"));
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// //if the minor version is not matched
|
|
||||||
// if (file_version.min() != app_version.min()) {
|
|
||||||
// wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Suggest to upgrade your software."),
|
|
||||||
// file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
|
||||||
// text += "\n";
|
|
||||||
// show_info(q, text, _L("Newer 3mf version"));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
|
wxString append = _L("You'd better upgrade your software.\n");
|
||||||
|
context += "\n\n";
|
||||||
|
// context += into_u8(append);
|
||||||
|
context += append;
|
||||||
|
show_info(q, context, _L("Newer 3mf version"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//if the minor version is not matched
|
||||||
|
if (file_version.min() != app_version.min()) {
|
||||||
|
wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Suggest to upgrade your software."),
|
||||||
|
file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string());
|
||||||
|
text += "\n";
|
||||||
|
show_info(q, text, _L("Newer 3mf version"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!load_config) {
|
else if (!load_config) {
|
||||||
// reset config except color
|
// reset config except color
|
||||||
for (ModelObject *model_object : model.objects) {
|
for (ModelObject *model_object : model.objects) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue