Skip to content

Commit

Permalink
Fix config loading for brim_offset
Browse files Browse the repository at this point in the history
Added a piece of code into handle_legacy to check for aliases.
'.mf3 files won't open 2.4.58.3' #2939
  • Loading branch information
supermerill committed Aug 10, 2022
1 parent e343bc7 commit 5c73d9d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/libslic3r/Format/3mf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3350,13 +3350,14 @@ bool _3MF_Exporter::_add_custom_gcode_per_print_z_file_to_archive( mz_zip_archiv
//FIXME provide a version of PrusaSlicer that stored the project file (3MF).
static void handle_legacy_project_loaded(unsigned int version_project_file, DynamicPrintConfig& config)
{
if (! config.has("brim_separation")) {
if (auto *opt_elephant_foot = config.option<ConfigOptionFloat>("first_layer_size_compensation", false); opt_elephant_foot) {
// Conversion from older PrusaSlicer which applied brim separation equal to elephant foot compensation.
auto *opt_brim_separation = config.option<ConfigOptionFloat>("brim_separation", true);
opt_brim_separation->value = opt_elephant_foot->value;
}
}
// SuSi: don't do that. It's hidden behavior.
//if (! config.has("brim_separation")) {
// if (auto *opt_elephant_foot = config.option<ConfigOptionFloat>("first_layer_size_compensation", false); opt_elephant_foot) {
// // Conversion from older PrusaSlicer which applied brim separation equal to elephant foot compensation.
// auto *opt_brim_separation = config.option<ConfigOptionFloat>("brim_separation", true);
// opt_brim_separation->value = -opt_elephant_foot->value;
// }
//}
}

bool is_project_3mf(const std::string& filename)
Expand Down
10 changes: 10 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6979,6 +6979,16 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
}

if (! print_config_def.has(opt_key)) {
//check the aliases
for(const auto& entry : print_config_def.options) {
for (const std::string& alias : entry.second.aliases) {
if (alias == opt_key) {
// translate
opt_key = entry.first;
return;
}
}
}
opt_key = "";
return;
}
Expand Down

0 comments on commit 5c73d9d

Please sign in to comment.