diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index d7784baa2..02f4abc2a 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1059,14 +1059,20 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* // Custom layering is not allowed for tree supports as of now. - for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) - if (const PrintObject &print_object = *m_objects[print_object_idx]; - print_object.has_support_material() && is_tree(print_object.config().support_type.value) && print_object.config().support_style.value == smsTreeOrganic && + for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++print_object_idx) { + PrintObject &print_object = *m_objects[print_object_idx]; + print_object.has_variable_layer_heights = false; + if (print_object.has_support_material() && is_tree(print_object.config().support_type.value) && print_object.model_object()->has_custom_layering()) { - if (const std::vector &layers = layer_height_profile(print_object_idx); ! layers.empty()) - if (! check_object_layers_fixed(print_object.slicing_parameters(), layers)) - return { L("Variable layer height is not supported with Organic supports.") }; + if (const std::vector &layers = layer_height_profile(print_object_idx); !layers.empty()) + if (!check_object_layers_fixed(print_object.slicing_parameters(), layers)) { + print_object.has_variable_layer_heights = true; + BOOST_LOG_TRIVIAL(warning) << "print_object: " << print_object.model_object()->name + << " has_variable_layer_heights: " << print_object.has_variable_layer_heights; + if (print_object.config().support_style.value == smsTreeOrganic) return {L("Variable layer height is not supported with Organic supports.")}; + } } + } if (this->has_wipe_tower() && ! m_objects.empty()) { // Make sure all extruders use same diameter filament and have the same nozzle diameter diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index ae15dd9cb..ec42606a8 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -446,6 +446,7 @@ public: // BBS: returns 1-based indices of extruders used to print the first layer wall of objects std::vector object_first_layer_wall_extruders; + bool has_variable_layer_heights = false; // OrcaSlicer size_t get_klipper_object_id() const { return m_klipper_object_id; } diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 0b392b25e..b0d38d31e 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -605,13 +605,13 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p support_type = m_object_config->support_type; support_style = m_object_config->support_style; if (support_style == smsDefault) { - // organic support doesn't work with adaptive layer height - if (object.model_object()->layer_height_profile.empty()) { + // organic support doesn't work with variable layer heights (including adaptive layer height and height range modifier, see #4313) + if (!m_object->has_variable_layer_heights) { BOOST_LOG_TRIVIAL(warning) << "tree support default to organic support"; support_style = smsTreeOrganic; } else { - BOOST_LOG_TRIVIAL(warning) << "Adaptive layer height is not supported for organic support, using hybrid tree support instead."; + BOOST_LOG_TRIVIAL(warning) << "tree support default to hybrid tree due to adaptive layer height"; support_style = smsTreeHybrid; } }