diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 062a1b0965..96bf83b819 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -1198,6 +1198,28 @@ std::vector PartPlate::get_extruders() const return plate_extruders; } +std::vector PartPlate::get_used_extruders() +{ + std::vector used_extruders; + // if gcode.3mf file + if (m_model->objects.empty()) { + for (int i = 0; i < slice_filaments_info.size(); i++) { + used_extruders.push_back(slice_filaments_info[i].id + 1); + } + return used_extruders; + } + + GCodeProcessorResult* result = get_slice_result(); + if (!result) + return used_extruders; + + PrintEstimatedStatistics& ps = result->print_statistics; + for (auto it = ps.volumes_per_extruder.begin(); it != ps.volumes_per_extruder.end(); it++) { + used_extruders.push_back(it->first + 1); + } + return used_extruders; +} + Vec3d PartPlate::estimate_wipe_tower_size(const double w, const double wipe_volume) const { Vec3d wipe_tower_size; diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index adafd842e1..f53b049b6a 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -259,6 +259,7 @@ public: Vec3d get_origin() { return m_origin; } Vec3d estimate_wipe_tower_size(const double w, const double wipe_volume) const; std::vector get_extruders() const; + std::vector get_used_extruders(); /* instance related operations*/ //judge whether instance is bound in plate or not diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 75dc19471b..831a9c0c86 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2930,7 +2930,7 @@ void SelectMachineDialog::set_default() } // material info - auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_extruders(); + auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders(); BitmapCache bmcache; MaterialHash::iterator iter = m_materialList.begin();