From e35124b627b6206ba457fdfc632f2d0ac7b3553d Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 29 Jan 2019 13:36:23 +0100 Subject: [PATCH 1/2] Fix of 1.42.0.alpha2 BUG ** Printer choosing bug #1588 --- src/slic3r/GUI/Preset.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index d4ee9cf5f..f0473b823 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -531,6 +531,9 @@ void PresetCollection::load_presets(const std::string &dir_path, const std::stri boost::filesystem::path dir = boost::filesystem::canonical(boost::filesystem::path(dir_path) / subdir).make_preferred(); m_dir_path = dir.string(); std::string errors_cummulative; + // Store the loaded presets into a new vector, otherwise the binary search for already existing presets would be broken. + // (see the "Preset already present, not loading" message). + std::deque presets_loaded; for (auto &dir_entry : boost::filesystem::directory_iterator(dir)) if (boost::filesystem::is_regular_file(dir_entry.status()) && boost::algorithm::iends_with(dir_entry.path().filename().string(), ".ini") && // Ignore system and hidden files, which may be created by the DropBox synchronisation process. @@ -568,12 +571,13 @@ void PresetCollection::load_presets(const std::string &dir_path, const std::stri } catch (const std::runtime_error &err) { throw std::runtime_error(std::string("Failed loading the preset file: ") + preset.file + "\n\tReason: " + err.what()); } - m_presets.emplace_back(preset); + presets_loaded.emplace_back(preset); } catch (const std::runtime_error &err) { errors_cummulative += err.what(); errors_cummulative += "\n"; } } + m_presets.insert(m_presets.end(), std::make_move_iterator(presets_loaded.begin()), std::make_move_iterator(presets_loaded.end())); std::sort(m_presets.begin() + m_num_default_presets, m_presets.end()); this->select_preset(first_visible_idx()); if (! errors_cummulative.empty()) From 15b6b4f2394e417ea3ba38d6a1aa4a915197ef3a Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 29 Jan 2019 14:16:31 +0100 Subject: [PATCH 2/2] Fix of #1730 --- src/libslic3r/Model.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index d86a180b8..86bd0d03b 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -489,6 +489,9 @@ void Model::convert_multipart_object(unsigned int max_extruders) { new_v->name = o->name; new_v->config.set_deserialize("extruder", get_auto_extruder_id_as_string(max_extruders)); +#if ENABLE_VOLUMES_CENTERING_FIXES + new_v->translate(-o->origin_translation); +#endif // ENABLE_VOLUMES_CENTERING_FIXES } }