diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index c31835869..1f036c048 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -941,7 +941,8 @@ void PresetCollection::load_presets(const std::string &dir_path, const std::stri } 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(this->type() == Preset::Type::TYPE_PRINTER) + this->select_preset(first_visible_idx()); if (! errors_cummulative.empty()) throw Slic3r::RuntimeError(errors_cummulative); } @@ -1329,6 +1330,8 @@ size_t PresetCollection::update_compatible_internal(const PresetWithVendorProfil if (opt) config.set_key_value("num_milling", new ConfigOptionInt((int)static_cast(opt)->values.size())); bool some_compatible = false; + if(m_idx_selected < m_num_default_presets && unselect_if_incompatible != PresetSelectCompatibleType::Never) + m_idx_selected = size_t(-1); for (size_t idx_preset = m_num_default_presets; idx_preset < m_presets.size(); ++ idx_preset) { bool selected = idx_preset == m_idx_selected; Preset &preset_selected = m_presets[idx_preset]; diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 88c95fe77..ce7ca17ce 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1481,7 +1481,10 @@ void PresetBundle::update_compatible(PresetSelectCompatibleType select_other_pri { public: PreferedPrintProfileMatch(const Preset &preset, const std::string &prefered_name) : - PreferedProfileMatch(preset.alias, prefered_name), m_prefered_layer_height(preset.config.opt_float("layer_height")) {} + PreferedProfileMatch(preset.alias, prefered_name), m_alias_preset(preset), m_prefered_layer_height(0){ + if(!preset.alias.empty()) + m_prefered_layer_height = preset.config.opt_float("layer_height"); + } int operator()(const Preset &preset) const { @@ -1495,7 +1498,8 @@ void PresetBundle::update_compatible(PresetSelectCompatibleType select_other_pri } private: - const double m_prefered_layer_height; + double m_prefered_layer_height; + const Preset& m_alias_preset; }; // Matching by the layer height in addition.