FIX: [STUDIO-1694] change support filament to default if out of range

Change-Id: Ie67b1832ec92cd66c14461d01363bbf2c2069185
This commit is contained in:
chunmao.guo 2022-12-09 10:34:43 +08:00 committed by Lane.Wei
parent 88fbcb181e
commit 31ff48ccca
3 changed files with 11 additions and 2 deletions

View file

@ -607,6 +607,11 @@ void ObjectList::update_filament_values_for_items(const size_t filaments_count)
}
m_objects_model->SetExtruder(extruder, item);
static const char *keys[] = {"support_filament", "support_interface_filament"};
for (auto key : keys)
if (object->config.has(key) && object->config.opt_int(key) > filaments_count)
object->config.erase(key);
if (object->volumes.size() > 1) {
for (size_t id = 0; id < object->volumes.size(); id++) {
item = m_objects_model->GetItemByVolumeId(i, id);
@ -620,6 +625,10 @@ void ObjectList::update_filament_values_for_items(const size_t filaments_count)
}
m_objects_model->SetExtruder(extruder, item);
for (auto key : keys)
if (object->volumes[id]->config.has(key) && object->volumes[id]->config.opt_int(key) > filaments_count)
object->volumes[id]->config.erase(key);
}
}
}