mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-06 06:47:41 -07:00
FIX: All extruder layer heights must be consistent in mutli-extruder
jira: STUDIO-8901 Change-Id: I713cfb298d26133daf86b94cf03a02833e8245cd (cherry picked from commit e02482bcce207900daedafce05b2551a4baa57f3)
This commit is contained in:
parent
233edf9502
commit
da0adbf498
1 changed files with 24 additions and 0 deletions
|
|
@ -1768,6 +1768,30 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_preset_bundle->get_printer_extruder_count() > 1){
|
||||
int extruder_idx = std::atoi(opt_key.substr(opt_key.find_last_of('#') + 1).c_str());
|
||||
if (opt_key.find("min_layer_height") != std::string::npos) {
|
||||
auto min_layer_height_from_nozzle = m_preset_bundle->full_config().option<ConfigOptionFloatsNullable>("min_layer_height")->values;
|
||||
if (extruder_idx < min_layer_height_from_nozzle.size()) {
|
||||
double value = min_layer_height_from_nozzle[extruder_idx];
|
||||
std::fill(min_layer_height_from_nozzle.begin(), min_layer_height_from_nozzle.end(), value);
|
||||
}
|
||||
auto new_conf = *m_config;
|
||||
new_conf.set_key_value("min_layer_height", new ConfigOptionFloatsNullable(min_layer_height_from_nozzle));
|
||||
m_config_manipulation.apply(m_config, &new_conf);
|
||||
}
|
||||
else if (opt_key.find("max_layer_height") != std::string::npos) {
|
||||
auto max_layer_height_from_nozzle = m_preset_bundle->full_config().option<ConfigOptionFloatsNullable>("max_layer_height")->values;
|
||||
if (extruder_idx < max_layer_height_from_nozzle.size()) {
|
||||
double value = max_layer_height_from_nozzle[extruder_idx];
|
||||
std::fill(max_layer_height_from_nozzle.begin(), max_layer_height_from_nozzle.end(), value);
|
||||
}
|
||||
auto new_conf = *m_config;
|
||||
new_conf.set_key_value("max_layer_height", new ConfigOptionFloatsNullable(max_layer_height_from_nozzle));
|
||||
m_config_manipulation.apply(m_config, &new_conf);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_postpone_update_ui) {
|
||||
// It means that not all values are rolled to the system/last saved values jet.
|
||||
// And call of the update() can causes a redundant check of the config values,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue