diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index d8efbe769..ce8675136 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1866,7 +1866,7 @@ bool MainFrame::get_enable_print_status() } else if (m_print_select == eExportSlicedFile) { - if (!current_plate->is_slice_result_ready_for_print()) + if (!current_plate->is_slice_result_ready_for_export()) { enable = false; } @@ -1889,7 +1889,7 @@ bool MainFrame::get_enable_print_status() } else if (m_print_select == eExportAllSlicedFile) { - if (!part_plate_list.is_all_slice_results_ready_for_print()) + if (!part_plate_list.is_all_slice_result_ready_for_export()) { enable = false; } diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index b91dcb0c2..765b722f8 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -4728,6 +4728,30 @@ bool PartPlateList::is_all_slice_results_ready_for_print() const return res; } +//check whether all plates' slice result valid for export to file +bool PartPlateList::is_all_slice_result_ready_for_export() const +{ + bool res = false; + + for (unsigned int i = 0; i < (unsigned int) m_plate_list.size(); ++i) { + if (!m_plate_list[i]->empty()) { + if (m_plate_list[i]->is_all_instances_unprintable()) { + continue; + } + if (!m_plate_list[i]->is_slice_result_ready_for_print()) { + return false; + } + } + if (m_plate_list[i]->is_slice_result_ready_for_print()) { + if (!m_plate_list[i]->has_printable_instances()) { + return false; + } + res = true; + } + } + + return res; +} //check whether all plates ready for slice bool PartPlateList::is_all_plates_ready_for_slice() const diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index 434ea93a4..188297609 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -411,6 +411,12 @@ public: return result; } + // check whether plate's slice result valid for export to file + bool is_slice_result_ready_for_export() + { + return is_slice_result_ready_for_print() && has_printable_instances(); + } + //invalid sliced result void update_slice_result_valid_state(bool valid = false); @@ -775,6 +781,7 @@ public: bool is_all_slice_results_valid() const; bool is_all_slice_results_ready_for_print() const; bool is_all_plates_ready_for_slice() const; + bool is_all_slice_result_ready_for_export() const; void print() const; //get the all the sliced result