From c6e5074114c5544974b07612c06faee3e78a912c Mon Sep 17 00:00:00 2001 From: Ian Bassi Date: Fri, 29 May 2026 16:11:22 -0300 Subject: [PATCH] Remove legacy check --- src/OrcaSlicer.cpp | 15 +-------------- src/libslic3r/Config.hpp | 28 ---------------------------- src/slic3r/GUI/Plater.cpp | 17 ----------------- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 2e445cadfd..7107e1ba1e 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -1591,7 +1591,7 @@ int CLI::run(int argc, char **argv) record_exit_reson(outfile_dir, CLI_FILE_VERSION_NOT_SUPPORTED, 0, cli_errors[CLI_FILE_VERSION_NOT_SUPPORTED], sliced_info); flush_and_exit(CLI_FILE_VERSION_NOT_SUPPORTED); } - Semver old_version(1, 5, 9), old_version2(1, 5, 9), old_version3(2, 0, 0), old_version4(2, 2, 0), old_version5("2.4.0"); + Semver old_version(1, 5, 9), old_version2(1, 5, 9), old_version3(2, 0, 0), old_version4(2, 2, 0); if ((file_version < old_version) && !config.empty()) { translate_old = true; BOOST_LOG_TRIVIAL(info) << boost::format("old 3mf version %1%, need to translate")%file_version.to_string(); @@ -1606,19 +1606,6 @@ int CLI::run(int argc, char **argv) BOOST_LOG_TRIVIAL(info) << boost::format("old 3mf version %1%, need to set enable_wrapping_detection to false")%file_version.to_string(); } - if ((file_version < old_version5) && !config.empty()) { - int converted_count = ConfigMigrations::migrate_legacy_feature_filament_defaults(config); - for (ModelObject *model_object : model.objects) { - converted_count += ConfigMigrations::migrate_legacy_feature_filament_defaults(model_object->config); - for (ModelVolume *model_volume : model_object->volumes) - converted_count += ConfigMigrations::migrate_legacy_feature_filament_defaults(model_volume->config); - } - - if (converted_count > 0) { - BOOST_LOG_TRIVIAL(info) << boost::format("old 3mf version %1%, migrated %2% feature filament selections from 1 to 0 (Default)") % file_version.to_string() % converted_count; - } - } - if (normative_check) { ConfigOptionStrings* postprocess_scripts = config.option("post_process"); if (postprocess_scripts) { diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 443a88d9d2..8ef014564c 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -2968,34 +2968,6 @@ private: std::ostream& operator<<(std::ostream& os, const DynamicConfig::DynamicConfigDifference& diff); -namespace ConfigMigrations { - -template -inline int migrate_legacy_feature_filament_defaults(ConfigLike &cfg) -{ - static const char *feature_filament_keys[] = { - "wall_filament", - "sparse_infill_filament", - "solid_infill_filament" - }; - - int converted_count = 0; - for (const char *key : feature_filament_keys) { - if (!cfg.has(key)) - continue; - - const ConfigOption *opt = cfg.option(key); - if (opt != nullptr && opt->getInt() == 1) { - cfg.set_key_value(key, new ConfigOptionInt(0)); - ++converted_count; - } - } - - return converted_count; -} - -} - // Configuration store with a static definition of configuration values. // In Slic3r, the static configuration stores are during the slicing / g-code generation for efficiency reasons, // because the configuration values could be accessed directly. diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 06d1575cca..d5c56d169b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6153,23 +6153,6 @@ std::vector Plater::priv::load_files(const std::vector& input_ } } - if (load_config && !config_loaded.empty() && - (en_3mf_file_type == En3mfType::From_BBS || en_3mf_file_type == En3mfType::From_Orca) && - file_version < Semver("2.4.0-dev")) { - int converted_count = ConfigMigrations::migrate_legacy_feature_filament_defaults(config_loaded); - for (ModelObject *model_object : model.objects) { - converted_count += ConfigMigrations::migrate_legacy_feature_filament_defaults(model_object->config); - for (ModelVolume *model_volume : model_object->volumes) - converted_count += ConfigMigrations::migrate_legacy_feature_filament_defaults(model_volume->config); - } - - if (converted_count > 0) { - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" << __LINE__ << " " - << boost::format("old 3mf version %1%, migrated %2% feature filament selections from 1 to 0 (Default)") - % file_version.to_string() % converted_count; - } - } - // plate data if (plate_data.size() > 0) { BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" << __LINE__ << boost::format(", import 3mf UPDATE_GCODE_RESULT \n");