Merge branch 'feature/cache_profiles_and_optimize_loading_speed' of https://github.com/OrcaSlicer/OrcaSlicer into feature/cache_profiles_and_optimize_loading_speed

This commit is contained in:
ExPikaPaka
2026-06-17 08:50:38 +02:00
166 changed files with 10735 additions and 1874 deletions

View File

@@ -2186,7 +2186,7 @@ private:
else
throw ConfigurationError("Serializing NaN");
}
else {
else if (this->keys_map != nullptr) {
for (const auto& kvp : *this->keys_map)
if (kvp.second == v)
ss << kvp.first;

View File

@@ -2194,7 +2194,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
BOOST_LOG_TRIVIAL(info) << "Exporting G-code finished" << log_memory_info();
print->set_done(psGCodeExport);
if(is_BBL_Printer())
if(is_BBL_Printer() && result != nullptr)
result->label_object_enabled = m_enable_exclude_object;
// Write the profiler measurements to file
PROFILE_UPDATE();

View File

@@ -19,6 +19,10 @@ arrangement::ArrangePolygons get_arrange_polys(const Model &model, ModelInstance
for (ModelObject *mo : model.objects)
for (ModelInstance *minst : mo->instances) {
minst->get_arrange_polygon(&ap);
// ModelInstance::get_arrange_polygon leaves bed_idx at its UNARRANGED
// default; seed it to bed 0 (as get_instance_arrange_poly does) so the
// nester treats the item as placeable instead of returning it unplaced.
ap.bed_idx = 0;
input.emplace_back(ap);
instances.emplace_back(minst);
}

View File

@@ -2366,6 +2366,10 @@ bool PresetCollection::validate_preset(const std::string &preset_name, std::stri
const std::string canonical_inherit_name = this->canonical_preset_name(inherit_name);
it = this->find_preset_internal(canonical_inherit_name);
found = it != m_presets.end() && it->name == canonical_inherit_name && is_trusted(*it);
if (!found) {
it = this->find_preset_renamed(canonical_inherit_name);
found = it != m_presets.end() && is_trusted(*it);
}
if (found)
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": preset_name %1%, inherit_name %2%, found inherit in list")%preset_name %inherit_name;
else
@@ -2457,7 +2461,9 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
if (!inherits.empty() && (different_settings_list.size() > 0)) {
auto iter = this->find_preset_internal(inherits);
if (iter != m_presets.end() && iter->name == inherits) {
if (iter == m_presets.end() || iter->name != inherits)
iter = this->find_preset_renamed(inherits);
if (iter != m_presets.end()) {
//std::vector<std::string> dirty_options = cfg.diff(iter->config);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": change preset %1% inherit %2% 's value to %3% 's values")%original_name %inherits %path;
cfg.update_non_diff_values_to_base_config(iter->config, keys, different_settings_list, extruder_id_name, extruder_variant_name, *key_set1, *key_set2);
@@ -2509,7 +2515,9 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
// and override its settings with the loaded ones.
assert(it == m_presets.end());
it = this->find_preset_internal(inherits);
found = it != m_presets.end() && it->name == inherits;
if (it == m_presets.end() || it->name != inherits)
it = this->find_preset_renamed(inherits);
found = it != m_presets.end();
if (found && profile_print_params_same(it->config, cfg)) {
// The system preset exists and it matches the values stored inside config.
if (select == LoadAndSelect::Always)

View File

@@ -2632,7 +2632,8 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor
gcode.do_export(this, path.c_str(), result, thumbnail_cb);
gcode.export_layer_filaments(result);
//BBS
result->conflict_result = m_conflict_result;
if (result != nullptr)
result->conflict_result = m_conflict_result;
return path.c_str();
}

View File

@@ -1284,15 +1284,14 @@ void PrintConfigDef::init_fff_params()
def = this->add("bridge_density", coPercent);
def->label = L("External bridge density");
def->category = L("Strength");
def->tooltip = L("Controls the density (spacing) of external bridge lines. Default is 100%.\n"
def->tooltip = L("Controls the density (spacing) of external bridge lines.\n"
"Theoretically, 100% means a solid bridge, but due to the tendency of bridge extrusions to sag, 100% may not be sufficient.\n\n"
"- Higher than 100% density (Recommended Max 125%):\n"
" - Pros: Produces smoother bridge surfaces, as overlapping lines provide additional support during printing.\n"
" - Cons: Can cause overextrusion, which may reduce lower and upper surface quality and increase the risk of warping.\n\n"
"- Lower than 100% density (Min 10%):\n"
" - Pros: Can create a string-like first layer. Faster and with better cooling because there is more space for air to circulate around the extruded bridge.\n"
" - Cons: May lead to sagging and poorer surface finish.\n\n"
"Recommended range: Minimum 10% - Maximum 125%.");
" - Cons: May lead to sagging and poorer surface finish.");
def->sidetext = "%";
def->min = 10;
def->max = 125;
@@ -1302,7 +1301,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("internal_bridge_density", coPercent);
def->label = L("Internal bridge density");
def->category = L("Strength");
def->tooltip = L("Controls the density (spacing) of internal bridge lines. Default is 100%. 100% means a solid internal bridge.\n\n"
def->tooltip = L("Controls the density (spacing) of internal bridge lines.\n"
"Internal bridges act as intermediate support between sparse infill and top solid infill and can strongly affect top surface quality.\n\n"
"- Higher than 100% density (Recommended Max 125%):\n"
" - Pros: Improves internal bridge strength and support under top layers, reducing sagging and improving top-surface finish.\n"
@@ -1332,7 +1331,7 @@ void PrintConfigDef::init_fff_params()
def = this->add("bridge_line_width", coFloatOrPercent);
def->label = L("Bridge");
def->category = L("Quality");
def->tooltip = L("Bridge line width is expressed either as an absolute value or as a percentage of the active nozzle diameter (percentages are computed from the nozzle diameter).\n"
def->tooltip = L("Line width of the Bridge. If expressed as a %, it will be computed over the nozzle diameter.\n"
"Recommended to use with a higher Bridge density or Bridge flow ratio.\n\n"
"The maximum value is 100% or the nozzle diameter.\n"
"If set to 0, the line width will match the Internal solid infill width.");