Remove legacy check

This commit is contained in:
Ian Bassi
2026-05-29 16:11:22 -03:00
parent 5f1efac0ea
commit c6e5074114
3 changed files with 1 additions and 59 deletions
+1 -14
View File
@@ -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); 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); 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()) { if ((file_version < old_version) && !config.empty()) {
translate_old = true; translate_old = true;
BOOST_LOG_TRIVIAL(info) << boost::format("old 3mf version %1%, need to translate")%file_version.to_string(); 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(); 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) { if (normative_check) {
ConfigOptionStrings* postprocess_scripts = config.option<ConfigOptionStrings>("post_process"); ConfigOptionStrings* postprocess_scripts = config.option<ConfigOptionStrings>("post_process");
if (postprocess_scripts) { if (postprocess_scripts) {
-28
View File
@@ -2968,34 +2968,6 @@ private:
std::ostream& operator<<(std::ostream& os, const DynamicConfig::DynamicConfigDifference& diff); std::ostream& operator<<(std::ostream& os, const DynamicConfig::DynamicConfigDifference& diff);
namespace ConfigMigrations {
template <typename ConfigLike>
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. // 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, // In Slic3r, the static configuration stores are during the slicing / g-code generation for efficiency reasons,
// because the configuration values could be accessed directly. // because the configuration values could be accessed directly.
-17
View File
@@ -6153,23 +6153,6 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& 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 // plate data
if (plate_data.size() > 0) { if (plate_data.size() > 0) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" << __LINE__ << boost::format(", import 3mf UPDATE_GCODE_RESULT \n"); BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" << __LINE__ << boost::format(", import 3mf UPDATE_GCODE_RESULT \n");