diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 39cce774c..7e45caa3b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3850,6 +3850,16 @@ std::vector Plater::priv::load_files(const std::vector& input_ //always load config { + // BBS: save the wipe tower pos in file here, will be used later + ConfigOptionFloats* wipe_tower_x_opt = config.opt("wipe_tower_x"); + ConfigOptionFloats* wipe_tower_y_opt = config.opt("wipe_tower_y"); + std::optionalfile_wipe_tower_x; + std::optionalfile_wipe_tower_y; + if (wipe_tower_x_opt) + file_wipe_tower_x = *wipe_tower_x_opt; + if (wipe_tower_y_opt) + file_wipe_tower_y = *wipe_tower_y_opt; + preset_bundle->load_config_model(filename.string(), std::move(config), file_version); ConfigOption* bed_type_opt = preset_bundle->project_config.option("curr_bed_type"); @@ -3928,6 +3938,17 @@ std::vector Plater::priv::load_files(const std::vector& input_ // when for extruder colors are used filament colors q->on_filaments_change(preset_bundle->filament_presets.size()); is_project_file = true; + + //BBS: rewrite wipe tower pos stored in 3mf file , the code above should be seriously reconsidered + { + DynamicConfig& proj_cfg = wxGetApp().preset_bundle->project_config; + ConfigOptionFloats* wipe_tower_x = proj_cfg.opt("wipe_tower_x"); + ConfigOptionFloats* wipe_tower_y = proj_cfg.opt("wipe_tower_y"); + if (file_wipe_tower_x) + *wipe_tower_x = *file_wipe_tower_x; + if (file_wipe_tower_y) + *wipe_tower_y = *file_wipe_tower_y; + } } } if (!silence) wxGetApp().app_config->update_config_dir(path.parent_path().string());