Skip to content

Commit

Permalink
Better way of storing the global scarf state
Browse files Browse the repository at this point in the history
  • Loading branch information
Noisyfox committed Feb 1, 2024
1 parent 8006927 commit ef90d48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1913,14 +1913,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
{
PROFILE_FUNC();

PrintConfig print_config(print.config());
{
const auto o = print.objects();
print_config.has_scarf_joint_seam.value = std::any_of(o.begin(), o.end(),
[](const PrintObject* obj) { return obj->config().seam_slope_enabled; });
}
// modifies m_silent_time_estimator_enabled
DoExport::init_gcode_processor(print_config, m_processor, m_silent_time_estimator_enabled);
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);

const bool is_bbl_printers = print.is_BBL_printer();
m_calib_config.clear();
Expand Down
13 changes: 13 additions & 0 deletions src/libslic3r/PrintApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,19 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
else
m_support_used = false;

{
const auto& o = model.objects;
const bool has_scarf_joint_seam = std::any_of(o.begin(), o.end(), [&new_full_config](ModelObject* obj) {
return obj->get_config_value<ConfigOptionBool>(new_full_config, "seam_slope_enabled")->value;
});

if (has_scarf_joint_seam) {
new_full_config.set("has_scarf_joint_seam", true);
}

BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", has_scarf_joint_seam:" << has_scarf_joint_seam;
}

// Find modified keys of the various configs. Resolve overrides extruder retract values by filament profiles.
DynamicPrintConfig filament_overrides;
//BBS: add plate index
Expand Down

0 comments on commit ef90d48

Please sign in to comment.