FIX: STUDIO-787 & STUDIO-786 lion face model problem

1. memory explosion when enable timelapse.
2. Models with only one color become multicolor after slicing.

Change-Id: Iab3ace70c08d03ab612158d52ff67eef8d5bc718
This commit is contained in:
zhimin.zeng 2022-09-02 16:51:17 +08:00 committed by Lane.Wei
parent db83a1c193
commit 612204b443
3 changed files with 13 additions and 6 deletions

View file

@ -175,8 +175,13 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
this->collect_extruders(*object, per_layer_extruder_switches); this->collect_extruders(*object, per_layer_extruder_switches);
// Reorder the extruders to minimize tool switches. // Reorder the extruders to minimize tool switches.
std::vector<unsigned int> first_layer_tool_order;
if (first_extruder == (unsigned int)-1) { if (first_extruder == (unsigned int)-1) {
this->reorder_extruders(generate_first_layer_tool_order(print)); first_layer_tool_order = generate_first_layer_tool_order(print);
}
if (!first_layer_tool_order.empty()) {
this->reorder_extruders(first_layer_tool_order);
} }
else { else {
this->reorder_extruders(first_extruder); this->reorder_extruders(first_extruder);

View file

@ -1777,11 +1777,10 @@ void Print::_make_wipe_tower()
// BBS: priming logic is removed, so don't consider it in tool ordering // BBS: priming logic is removed, so don't consider it in tool ordering
m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int)-1, false); m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int)-1, false);
// if enable_timelapse_print(), update all layer_tools parameters(has_wipe_tower, wipe_tower_partitions) // if enable_timelapse_print(), update all layer_tools parameters: wipe_tower_partitions
if (enable_timelapse_print()) { if (enable_timelapse_print()) {
std::vector<LayerTools>& layer_tools_array = m_wipe_tower_data.tool_ordering.layer_tools(); std::vector<LayerTools>& layer_tools_array = m_wipe_tower_data.tool_ordering.layer_tools();
for (LayerTools& layer_tools : layer_tools_array) { for (LayerTools& layer_tools : layer_tools_array) {
layer_tools.has_wipe_tower = true;
if (layer_tools.wipe_tower_partitions == 0) { if (layer_tools.wipe_tower_partitions == 0) {
layer_tools.wipe_tower_partitions = 1; layer_tools.wipe_tower_partitions = 1;
} }

View file

@ -3521,9 +3521,12 @@ void DynamicPrintConfig::normalize_fdm(int used_filaments)
ConfigOptionBool* islh_opt = this->option<ConfigOptionBool>("independent_support_layer_height", true); ConfigOptionBool* islh_opt = this->option<ConfigOptionBool>("independent_support_layer_height", true);
ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height"); ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
ConfigOptionEnum<PrintSequence>* ps_opt = this->option<ConfigOptionEnum<PrintSequence>>("print_sequence"); ConfigOptionEnum<PrintSequence>* ps_opt = this->option<ConfigOptionEnum<PrintSequence>>("print_sequence");
if (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject) ConfigOptionBool *timelapse_opt = this->option<ConfigOptionBool>("timelapse_no_toolhead");
ept_opt->value = false; if (timelapse_opt && timelapse_opt->value == false) {
if (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject)
ept_opt->value = false;
}
if (ept_opt->value) { if (ept_opt->value) {
if (islh_opt) if (islh_opt)