Fix of MMU file detection not working consistently #2317

If a 3mf or amf file does not contain slicer's profile, and if it
looks like a multi-part object, slicer shall ask for loading it
as a multi-part object.
This commit is contained in:
bubnikv 2019-05-22 15:30:35 +02:00
parent 4e3218a03a
commit 38bd13463f

View File

@ -1643,6 +1643,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
const bool type_prusa = std::regex_match(path.string(), pattern_prusa); const bool type_prusa = std::regex_match(path.string(), pattern_prusa);
Slic3r::Model model; Slic3r::Model model;
bool is_project_file = type_prusa;
try { try {
if (type_3mf || type_zip_amf) { if (type_3mf || type_zip_amf) {
DynamicPrintConfig config; DynamicPrintConfig config;
@ -1666,6 +1667,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
Preset::normalize(config); Preset::normalize(config);
wxGetApp().preset_bundle->load_config_model(filename.string(), std::move(config)); wxGetApp().preset_bundle->load_config_model(filename.string(), std::move(config));
wxGetApp().load_current_presets(); wxGetApp().load_current_presets();
is_project_file = true;
} }
wxGetApp().app_config->update_config_dir(path.parent_path().string()); wxGetApp().app_config->update_config_dir(path.parent_path().string());
} }
@ -1685,7 +1687,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
{ {
// The model should now be initialized // The model should now be initialized
if (!type_3mf && !type_any_amf && !type_prusa) { if (! is_project_file) {
if (model.looks_like_multipart_object()) { if (model.looks_like_multipart_object()) {
wxMessageDialog dlg(q, _(L( wxMessageDialog dlg(q, _(L(
"This file contains several objects positioned at multiple heights. " "This file contains several objects positioned at multiple heights. "