mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 06:05:55 +08:00
filtering out common generic filaments with matching generic counterparts from vendor bundle
This commit is contained in:
parent
e33c80a681
commit
a1dc88551b
@ -1096,6 +1096,7 @@ size_t PresetCollection::update_compatible_internal(const PresetWithVendorProfil
|
||||
if (opt)
|
||||
config.set_key_value("num_extruders", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size()));
|
||||
bool some_compatible = false;
|
||||
std::vector<size_t> indexes_of_common_presets;
|
||||
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];
|
||||
@ -1112,7 +1113,25 @@ size_t PresetCollection::update_compatible_internal(const PresetWithVendorProfil
|
||||
m_idx_selected = size_t(-1);
|
||||
if (selected)
|
||||
preset_selected.is_compatible = preset_edited.is_compatible;
|
||||
if (preset_edited.vendor->common_profile) {
|
||||
indexes_of_common_presets.push_back(idx_preset);
|
||||
}
|
||||
}
|
||||
// filter out common generic profiles where profile with same alias and compability exists
|
||||
if (!indexes_of_common_presets.empty()) {
|
||||
for (size_t idx_preset = m_num_default_presets; idx_preset < m_presets.size(); ++idx_preset) {
|
||||
if (!m_presets[idx_preset].vendor->common_profile && m_presets[idx_preset].is_compatible) {
|
||||
std::string preset_alias = m_presets[idx_preset].alias;
|
||||
for (size_t idx_idx = 0; idx_idx < indexes_of_common_presets.size(); ++idx_idx) {
|
||||
size_t idx_common = indexes_of_common_presets[idx_idx];
|
||||
if (m_presets[idx_common].alias == preset_alias) {
|
||||
m_presets[idx_common].is_compatible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update visibility of the default profiles here if the defaults are suppressed, the current profile is not compatible and we don't want to select another compatible profile.
|
||||
if (m_idx_selected >= m_num_default_presets && m_default_suppressed)
|
||||
for (size_t i = 0; i < m_num_default_presets; ++ i)
|
||||
|
@ -2177,7 +2177,7 @@ void ConfigWizard::priv::update_materials(Technology technology)
|
||||
}
|
||||
}
|
||||
// common filament bundle has no printers - filament would be never added
|
||||
if(pair.second.preset_bundle->printers.begin() == pair.second.preset_bundle->printers.end())
|
||||
if(pair.second.vendor_profile->common_profile && pair.second.preset_bundle->printers.begin() == pair.second.preset_bundle->printers.end())
|
||||
{
|
||||
if (!filaments.containts(&filament)) {
|
||||
filaments.push(&filament);
|
||||
|
Loading…
x
Reference in New Issue
Block a user