mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -06:00
ENH: some improvements to 3mf loading
1. convert instance to object when loading previous 3mf 2. fix an exception issue caused by previous commit caused by nil value of import_project_action Change-Id: Ieed853f0e8d458aab1716acf52307c5d672ebe22
This commit is contained in:
parent
1637981be5
commit
c0ccb733dd
2 changed files with 59 additions and 42 deletions
|
@ -934,6 +934,18 @@ ModelVolumeType type_from_string(const std::string &s)
|
||||||
++object_idx;
|
++object_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//BBS: copy object isteadof instance
|
||||||
|
int object_size = model.objects.size();
|
||||||
|
for (int obj_index = 0; obj_index < object_size; obj_index ++) {
|
||||||
|
ModelObject* object = model.objects[obj_index];
|
||||||
|
while (object->instances.size() > 1) {
|
||||||
|
ModelObject* new_model_object = model.add_object(*object);
|
||||||
|
new_model_object->clear_instances();
|
||||||
|
new_model_object->add_instance(*object->instances.back());
|
||||||
|
object->delete_last_instance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // fixes the min z of the model if negative
|
// // fixes the min z of the model if negative
|
||||||
// model.adjust_min_z();
|
// model.adjust_min_z();
|
||||||
|
|
||||||
|
|
|
@ -2948,7 +2948,12 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadType load_type = static_cast<LoadType>(std::stoi(wxGetApp().app_config->get("import_project_action")));
|
std::string import_project_action = wxGetApp().app_config->get("import_project_action");
|
||||||
|
LoadType load_type;
|
||||||
|
if (import_project_action.empty())
|
||||||
|
load_type = LoadType::Unknown;
|
||||||
|
else
|
||||||
|
load_type = static_cast<LoadType>(std::stoi(import_project_action));
|
||||||
|
|
||||||
// BBS: version check
|
// BBS: version check
|
||||||
Semver app_version = *(Semver::parse(SLIC3R_VERSION));
|
Semver app_version = *(Semver::parse(SLIC3R_VERSION));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue