FIX: wipe tower is not generate when insert custom gcode
Change-Id: I2e21955e4a29b0ee1aa3150f26ccef4db5850413 (cherry picked from commit 677151a26c9724993bad6d802015e76a700555f4)
This commit is contained in:
parent
34f52b213c
commit
96d2882b8d
2 changed files with 3 additions and 14 deletions
|
@ -341,7 +341,7 @@ std::vector<unsigned int> Print::extruders(bool conside_custom_gcode) const
|
|||
for (auto plate_data : m_model.plates_custom_gcodes) {
|
||||
for (auto item : plate_data.second.gcodes) {
|
||||
if (item.type == CustomGCode::Type::ToolChange)
|
||||
extruders.push_back((unsigned int)item.extruder);
|
||||
extruders.push_back((unsigned int)(item.extruder - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3176,19 +3176,8 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p
|
|||
}
|
||||
|
||||
if (wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptFFF) {
|
||||
// BBS
|
||||
// adds wipe tower's volume
|
||||
std::vector<int> print_extruders;
|
||||
for (auto print_obj : print.objects()) {
|
||||
ModelObject* mo = print_obj->model_object();
|
||||
for (ModelVolume* mv : mo->volumes) {
|
||||
std::vector<int> volume_extruders = mv->get_extruders();
|
||||
print_extruders.insert(print_extruders.end(), volume_extruders.begin(), volume_extruders.end());
|
||||
}
|
||||
}
|
||||
std::sort(print_extruders.begin(), print_extruders.end());
|
||||
auto it_end = std::unique(print_extruders.begin(), print_extruders.end());
|
||||
print_extruders.resize(std::distance(print_extruders.begin(), it_end));
|
||||
// BBS: adds wipe tower's volume
|
||||
std::vector<unsigned int> print_extruders = print.extruders(true);
|
||||
int extruders_count = print_extruders.size();
|
||||
|
||||
const double max_z = print.objects()[0]->model_object()->get_model()->bounding_box().max(2);
|
||||
|
|
Loading…
Reference in a new issue