diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index f91f273f9..b87dfa852 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -532,7 +532,7 @@ sub build { brim_width support_material support_material_threshold support_material_enforce_layers raft_layers - support_material_pattern support_material_with_sheath support_material_spacing support_material_angle + support_material_pattern support_material_with_sheath support_material_spacing support_material_synchronize_layers support_material_angle support_material_interface_layers support_material_interface_spacing support_material_contact_distance support_material_buildplate_only dont_support_bridges notes @@ -648,6 +648,7 @@ sub build { $optgroup->append_single_option_line('support_material_interface_spacing'); $optgroup->append_single_option_line('support_material_buildplate_only'); $optgroup->append_single_option_line('dont_support_bridges'); + $optgroup->append_single_option_line('support_material_synchronize_layers'); } } @@ -910,7 +911,7 @@ sub _update { my $have_support_interface = $config->support_material_interface_layers > 0; $self->get_field($_)->toggle($have_support_material) for qw(support_material_threshold support_material_pattern support_material_with_sheath - support_material_spacing support_material_angle + support_material_spacing support_material_synchronize_layers support_material_angle support_material_interface_layers dont_support_bridges support_material_extrusion_width support_material_contact_distance); $self->get_field($_)->toggle($have_support_material && $have_support_interface) diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 59dcea879..a56bdcdce 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1247,6 +1247,13 @@ PrintConfigDef::PrintConfigDef() def->min = 0; def->default_value = new ConfigOptionFloat(60); + def = this->add("support_material_synchronize_layers", coBool); + def->label = "Synchronize with object layers"; + def->category = "Support material"; + def->tooltip = "Synchronize support layers with the object print layers. This is useful with multi-material printers, where the extruder switch is expensive."; + def->cli = "support-material-synchronize-layers!"; + def->default_value = new ConfigOptionBool(true); + def = this->add("support_material_threshold", coInt); def->label = "Overhang threshold"; def->category = "Support material"; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index f4e6cb8c4..f908812fc 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -160,6 +160,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig ConfigOptionEnum support_material_pattern; ConfigOptionFloat support_material_spacing; ConfigOptionFloat support_material_speed; + ConfigOptionBool support_material_synchronize_layers; ConfigOptionInt support_material_threshold; ConfigOptionBool support_material_with_sheath; ConfigOptionFloat xy_size_compensation; @@ -194,6 +195,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig OPT_PTR(support_material_pattern); OPT_PTR(support_material_spacing); OPT_PTR(support_material_speed); + OPT_PTR(support_material_synchronize_layers); OPT_PTR(support_material_threshold); OPT_PTR(support_material_with_sheath); OPT_PTR(xy_size_compensation); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 3808a545e..9dcd73d39 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -203,6 +203,7 @@ PrintObject::invalidate_state_by_config_options(const std::vector