mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
FIX: cannot slice when set object extruder is 0
jira: none Change-Id: Idb6e01acc8ac7801331c3b6b4b0e64a23cc02208
This commit is contained in:
parent
d6e0cdaf16
commit
08751b0dee
1 changed files with 14 additions and 3 deletions
|
@ -5656,11 +5656,22 @@ void ObjectList::set_extruder_for_selected_items(const int extruder)
|
||||||
if (type & itLayerRoot)
|
if (type & itLayerRoot)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// BBS: handle extruder 0 for part, use it's parent extruder
|
||||||
|
int new_extruder = extruder;
|
||||||
|
if (extruder == 0) {
|
||||||
|
if (type & itObject) {
|
||||||
|
new_extruder = 1;
|
||||||
|
}
|
||||||
|
else if ((type & itVolume) && (m_objects_model->GetVolumeType(sel_item) == ModelVolumeType::MODEL_PART)) {
|
||||||
|
new_extruder = m_objects_model->GetExtruderNumber(m_objects_model->GetParent(sel_item));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ModelConfig& config = get_item_config(item);
|
ModelConfig& config = get_item_config(item);
|
||||||
if (config.has("extruder"))
|
if (config.has("extruder"))
|
||||||
config.set("extruder", extruder);
|
config.set("extruder", new_extruder);
|
||||||
else
|
else
|
||||||
config.set_key_value("extruder", new ConfigOptionInt(extruder));
|
config.set_key_value("extruder", new ConfigOptionInt(new_extruder));
|
||||||
|
|
||||||
// for object, clear all its part volume's extruder config
|
// for object, clear all its part volume's extruder config
|
||||||
if (type & itObject) {
|
if (type & itObject) {
|
||||||
|
@ -5671,7 +5682,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const wxString extruder_str = wxString::Format("%d", extruder);
|
const wxString extruder_str = wxString::Format("%d", new_extruder);
|
||||||
m_objects_model->SetExtruder(extruder_str, item);
|
m_objects_model->SetExtruder(extruder_str, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue