From 6f9dc88aa68373db78cf7a544f109994ed004076 Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 9 May 2020 19:05:33 +0200 Subject: [PATCH] #224 setting to force one skirt with complete_objects --- resources/ui_layout/print.ui | 1 + src/libslic3r/Print.cpp | 3 ++- src/libslic3r/PrintConfig.cpp | 14 +++++++++++--- src/libslic3r/PrintConfig.hpp | 2 ++ src/slic3r/GUI/ConfigManipulation.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 5 ++++- src/slic3r/GUI/Preset.cpp | 5 ++++- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/resources/ui_layout/print.ui b/resources/ui_layout/print.ui index 0f12a2ff4..a9c048932 100644 --- a/resources/ui_layout/print.ui +++ b/resources/ui_layout/print.ui @@ -260,6 +260,7 @@ group:Plater setting:duplicate_distance group:Sequential printing setting:complete_objects + setting:complete_objects_one_skirt line:Extruder clearance (mm) setting:width$6:extruder_clearance_radius setting:width$6:extruder_clearance_height diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index be0658cea..1bc130cc4 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -172,6 +172,7 @@ bool Print::invalidate_state_by_config_options(const std::vectorhas_skirt()) { this->set_status(88, L("Generating skirt")); - if (config().complete_objects){ + if (config().complete_objects && !config().complete_objects_one_skirt){ for (PrintObject *obj : m_objects){ //create a skirt "pattern" (one per object) const std::vector copies{ obj->instances() }; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 42f1eced2..e27849ad3 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -434,9 +434,17 @@ void PrintConfigDef::init_fff_params() def->label = L("Complete individual objects"); def->category = OptionCategory::output; def->tooltip = L("When printing multiple objects or copies, this feature will complete " - "each object before moving onto next one (and starting it from its bottom layer). " - "This feature is useful to avoid the risk of ruined prints. " - "Slic3r should warn and prevent you from extruder collisions, but beware."); + "each object before moving onto next one (and starting it from its bottom layer). " + "This feature is useful to avoid the risk of ruined prints. " + "Slic3r should warn and prevent you from extruder collisions, but beware."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + + def = this->add("complete_objects_one_skirt", coBool); + def->label = L("Allow only one skirt loop"); + def->category = OptionCategory::output; + def->tooltip = L("When using 'Complete individual objects', the default behavior is to draw the skirt around each object." + " if you prefer to have only one skirt for the whole plater, use this option."); def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(false)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 3d6291991..5ba6b096d 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -975,6 +975,7 @@ public: ConfigOptionInts bridge_fan_speed; ConfigOptionInts chamber_temperature; ConfigOptionBool complete_objects; + ConfigOptionBool complete_objects_one_skirt; ConfigOptionFloats colorprint_heights; ConfigOptionBools cooling; ConfigOptionFloat default_acceleration; @@ -1053,6 +1054,7 @@ protected: OPT_PTR(bridge_fan_speed); OPT_PTR(chamber_temperature); OPT_PTR(complete_objects); + OPT_PTR(complete_objects_one_skirt); OPT_PTR(colorprint_heights); OPT_PTR(cooling); OPT_PTR(default_acceleration); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 19ca23c96..108330795 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -396,7 +396,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("support_material_speed", have_support_material || have_brim || have_skirt); bool have_sequential_printing = config->opt_bool("complete_objects"); - for (auto el : { "extruder_clearance_radius", "extruder_clearance_height" }) + for (auto el : { "extruder_clearance_radius", "extruder_clearance_height", "complete_objects_one_skirt" }) toggle_field(el, have_sequential_printing); bool have_ooze_prevention = config->opt_bool("ooze_prevention"); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 40baf2d1a..97f5a43b5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2034,7 +2034,10 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) : q(q) , main_frame(main_frame) , config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({ - "bed_shape", "bed_custom_texture", "bed_custom_model", "complete_objects", "duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance", + "bed_shape", "bed_custom_texture", "bed_custom_model", + "complete_objects", + "complete_objects_one_skirt", + "duplicate_distance", "extruder_clearance_radius", "skirts", "skirt_distance", "brim_width", "variable_layer_height", "serial_port", "serial_speed", "host_type", "print_host", "printhost_apikey", "printhost_cafile", "nozzle_diameter", "single_extruder_multi_material", "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index b8a0d3e6e..f011770e2 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -478,7 +478,10 @@ const std::vector& Preset::print_options() , "support_material_contact_distance_type" , "support_material_contact_distance_top" , "support_material_contact_distance_bottom" - , "support_material_buildplate_only", "dont_support_bridges", "notes", "complete_objects", "extruder_clearance_radius", + , "support_material_buildplate_only", "dont_support_bridges", "notes", + "complete_objects", + "complete_objects_one_skirt", + "extruder_clearance_radius", "extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "perimeter_extruder", "infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder", "ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",