make Fuzzy skin options only available when Fuzzy skin is not disabled (#10312)

Mimicking the behavior of Ironing.

![demo](https://github.com/user-attachments/assets/443aa8c3-8b7c-4ab1-8445-4796185273d4)
This commit is contained in:
discip
2026-01-15 12:40:15 +01:00
committed by GitHub
parent 5c05e036c4
commit b37f68d778
6 changed files with 60 additions and 13 deletions

View File

@@ -215,7 +215,7 @@ bool should_fuzzify(const FuzzySkinConfig& config, const int layer_id, const siz
{
const auto fuzziy_type = config.type;
if (fuzziy_type == FuzzySkinType::None) {
if (fuzziy_type == FuzzySkinType::None|| fuzziy_type == FuzzySkinType::Disabled_fuzzy) {
return false;
}
if (!config.fuzzy_first_layer && layer_id <= 0) {

View File

@@ -839,7 +839,7 @@ bool verify_update_print_object_regions(
for (const PrintObjectRegions::FuzzySkinPaintedRegion &region : layer_range.fuzzy_skin_painted_regions) {
const PrintRegion &parent_print_region = *region.parent_print_object_region(layer_range);
PrintRegionConfig cfg = parent_print_region.config();
cfg.fuzzy_skin.value = FuzzySkinType::All;
if (cfg.fuzzy_skin.value != FuzzySkinType::Disabled_fuzzy) cfg.fuzzy_skin.value = FuzzySkinType::All;
if (cfg != region.region->config()) {
// Region configuration changed.
if (print_region_ref_cnt(*region.region) == 0) {
@@ -1081,7 +1081,7 @@ static PrintObjectRegions* generate_print_object_regions(
for (int parent_volume_region_id = 0; parent_volume_region_id < int(layer_range.volume_regions.size()); ++parent_volume_region_id) {
if (const PrintObjectRegions::VolumeRegion &parent_volume_region = layer_range.volume_regions[parent_volume_region_id]; parent_volume_region.model_volume->is_model_part() || parent_volume_region.model_volume->is_modifier()) {
PrintRegionConfig cfg = parent_volume_region.region->config();
cfg.fuzzy_skin.value = FuzzySkinType::All;
if (cfg.fuzzy_skin.value != FuzzySkinType::Disabled_fuzzy) cfg.fuzzy_skin.value = FuzzySkinType::All;
layer_range.fuzzy_skin_painted_regions.push_back({FuzzySkinParentType::VolumeRegion, parent_volume_region_id, get_create_region(std::move(cfg))});
}
}
@@ -1090,7 +1090,7 @@ static PrintObjectRegions* generate_print_object_regions(
const PrintObjectRegions::PaintedRegion &parent_painted_region = layer_range.painted_regions[parent_painted_regions_id];
PrintRegionConfig cfg = parent_painted_region.region->config();
cfg.fuzzy_skin.value = FuzzySkinType::All;
if (cfg.fuzzy_skin.value != FuzzySkinType::Disabled_fuzzy) cfg.fuzzy_skin.value = FuzzySkinType::All;
layer_range.fuzzy_skin_painted_regions.push_back({FuzzySkinParentType::PaintedRegion, parent_painted_regions_id, get_create_region(std::move(cfg))});
}

View File

@@ -173,7 +173,8 @@ static t_config_enum_values s_keys_map_FuzzySkinType {
{ "none", int(FuzzySkinType::None) },
{ "external", int(FuzzySkinType::External) },
{ "all", int(FuzzySkinType::All) },
{ "allwalls", int(FuzzySkinType::AllWalls)}
{ "allwalls", int(FuzzySkinType::AllWalls)},
{ "disabled_fuzzy", int(FuzzySkinType::Disabled_fuzzy)}
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(FuzzySkinType)
@@ -3223,12 +3224,14 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("external");
def->enum_values.push_back("all");
def->enum_values.push_back("allwalls");
def->enum_labels.push_back(L("None"));
def->enum_values.push_back("disabled_fuzzy");
def->enum_labels.push_back(L("None (allow paint)"));
def->enum_labels.push_back(L("Contour"));
def->enum_labels.push_back(L("Contour and hole"));
def->enum_labels.push_back(L("All walls"));
def->enum_labels.push_back(L("Disabled"));
def->mode = comSimple;
def->set_default_value(new ConfigOptionEnum<FuzzySkinType>(FuzzySkinType::None));
def->set_default_value(new ConfigOptionEnum<FuzzySkinType>(FuzzySkinType::Disabled_fuzzy));
def = this->add("fuzzy_skin_thickness", coFloat);
def->label = L("Fuzzy skin thickness");

View File

@@ -41,6 +41,7 @@ enum class FuzzySkinType {
External,
All,
AllWalls,
Disabled_fuzzy,
};
enum class FuzzySkinMode {