diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c46de72179..c9c48fce7d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2180,16 +2180,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // No object to print was found, cancel the G-code export. throw Slic3r::SlicingError(_(L("No object can be printed. Maybe too small"))); has_wipe_tower = print.has_wipe_tower() && tool_ordering.has_wipe_tower(); - // BBS: priming logic is removed, so 1st layer tool_ordering also respect the object tool sequence -#if 0 + // Orca: support all extruder priming initial_extruder_id = (has_wipe_tower && !print.config().single_extruder_multi_material_priming) ? // The priming towers will be skipped. tool_ordering.all_extruders().back() : // Don't skip the priming towers. tool_ordering.first_extruder(); -#else - initial_extruder_id = tool_ordering.first_extruder(); -#endif + //BBS: try to find the non-support filament extruder if is multi color and initial_extruder is support filament if (initial_extruder_id != static_cast(-1)) { initial_non_support_extruder_id = initial_extruder_id; @@ -2270,7 +2267,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato this->placeholder_parser().set("current_object_idx", 0); // For the start / end G-code to do the priming and final filament pull in case there is no wipe tower provided. this->placeholder_parser().set("has_wipe_tower", has_wipe_tower); - //this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming); + this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming); this->placeholder_parser().set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change). this->placeholder_parser().set("num_extruders", int(print.config().nozzle_diameter.values.size())); this->placeholder_parser().set("retract_length", new ConfigOptionFloats(print.config().retraction_length)); @@ -2511,8 +2508,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } } - // BBS: priming logic is removed, always set first extruer here. - //if (! (has_wipe_tower && print.config().single_extruder_multi_material_priming)) + // Orca: support extruder priming + if (! (has_wipe_tower && print.config().single_extruder_multi_material_priming)) { // Set initial extruder only after custom start G-code. // Ugly hack: Do not set the initial extruder if the extruder is primed using the MMU priming towers at the edge of the print bed. @@ -2642,7 +2639,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_wipe_tower.reset(new WipeTowerIntegration(print.config(), print.get_plate_index(), print.get_plate_origin(), * print.wipe_tower_data().priming.get(), print.wipe_tower_data().tool_changes, *print.wipe_tower_data().final_purge.get())); //BBS file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); - #if 0 + if (print.config().single_extruder_multi_material_priming) { file.write(m_wipe_tower->prime(*this)); // Verify, whether the print overaps the priming extrusions. @@ -2667,19 +2664,17 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write("M1 S10\n"); } } - //BBS: only support Marlin - //else { + else { // This is not Marlin, M1 command is probably not supported. - //if (overlap) { - // print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, - // _(L("Your print is very close to the priming regions. " - // "Make sure there is no collision."))); - //} else { - // // Just continue printing, no action necessary. - //} - //} + if (overlap) { + print.active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, + _(L("Your print is very close to the priming regions. " + "Make sure there is no collision."))); + } else { + // Just continue printing, no action necessary. + } + } } - #endif print.throw_if_canceled(); } // Process all layers of all objects (non-sequential mode) with a parallel pipeline: diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 5e5f4bf284..6bb1ff8508 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2061,14 +2061,6 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) tool_ordering = this->tool_ordering(); tool_ordering.assign_custom_gcodes(*this); has_wipe_tower = this->has_wipe_tower() && tool_ordering.has_wipe_tower(); - //BBS: have no single_extruder_multi_material_priming -#if 0 - initial_extruder_id = (has_wipe_tower && !this->config().single_extruder_multi_material_priming) ? - // The priming towers will be skipped. - tool_ordering.all_extruders().back() : - // Don't skip the priming towers. - tool_ordering.first_extruder(); -#endif initial_extruder_id = tool_ordering.first_extruder(); print_object_instances_ordering = chain_print_object_instances(*this); append(printExtruders, tool_ordering.tools_for_layer(layers_to_print.front().first).extruders); @@ -2581,9 +2573,19 @@ void Print::_make_wipe_tower() for (unsigned int i = 0; i(flush_matrix.begin()+i*number_of_extruders, flush_matrix.begin()+(i+1)*number_of_extruders)); + // Orca: itertate over wipe_volumes and change the non-zero values to the prime_volume + if (!m_config.purge_in_prime_tower && !is_BBL_printer()) { + for (unsigned int i = 0; i < number_of_extruders; ++i) { + for (unsigned int j = 0; j < number_of_extruders; ++j) { + if (wipe_volumes[i][j] > 0) { + wipe_volumes[i][j] = m_config.prime_volume; + } + } + } + } + // Let the ToolOrdering class know there will be initial priming extrusions at the start of the print. - // 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, true); if (!m_wipe_tower_data.tool_ordering.has_wipe_tower()) // Don't generate any wipe tower. @@ -2734,13 +2736,13 @@ void Print::_make_wipe_tower() for (size_t i = 0; i < number_of_extruders; ++i) wipe_tower.set_extruder(i, m_config); - // m_wipe_tower_data.priming = Slic3r::make_unique>( - // wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false)); + m_wipe_tower_data.priming = Slic3r::make_unique>( + wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false)); // Lets go through the wipe tower layers and determine pairs of extruder changes for each // to pass to wipe_tower (so that it can use it for planning the layout of the tower) { - unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder(); + unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.all_extruders().back(); for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers if (!layer_tools.has_wipe_tower) continue; @@ -2748,7 +2750,7 @@ void Print::_make_wipe_tower() wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id, false); for (const auto extruder_id : layer_tools.extruders) { - if (/*(first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || */ extruder_id != + if ((first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || extruder_id != current_extruder_id) { float volume_to_wipe = m_config.prime_volume; if (m_config.purge_in_prime_tower) { diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index be5bb65a51..263f57e19b 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -675,8 +675,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool purge_in_primetower = preset_bundle->printers.get_edited_preset().config.opt_bool("purge_in_prime_tower"); + // Orca: do we really need to hide these options when not purge_in_primetower? for (auto el : {"wipe_tower_rotation_angle", "wipe_tower_cone_angle", "wipe_tower_extra_spacing", "wipe_tower_max_purge_speed", "wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming"}) - toggle_line(el, have_prime_tower && purge_in_primetower); + toggle_line(el, have_prime_tower); toggle_line("prime_volume",have_prime_tower && !purge_in_primetower);