FIX:Only third-party printers record custom bed

and svg.This can reduce the preset differences in the copying system
jira:none

Change-Id: I6e6add2a9c796d8d42b7f8b7eccc1052250e5ffe
This commit is contained in:
zhou.xu 2024-10-25 10:38:15 +08:00 committed by Lane.Wei
parent 8cdaea1162
commit dbe2e5325d
1 changed files with 14 additions and 12 deletions

View File

@ -5117,21 +5117,23 @@ void Tab::save_preset(std::string name /*= ""*/, bool detach, bool save_to_proje
std::map<std::string, std::string> extra_map; std::map<std::string, std::string> extra_map;
{ {
bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(curr_preset).size() > 0; bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(curr_preset).size() > 0;
if (is_configed_by_BBL && wxGetApp().app_config->has_section("user_bbl_svg_list")) { if (is_configed_by_BBL) {//only record svg
auto user_bbl_svg_list = wxGetApp().app_config->get_section("user_bbl_svg_list"); if (wxGetApp().app_config->has_section("user_bbl_svg_list")) {
if (user_bbl_svg_list.size() > 0 && user_bbl_svg_list[curr_preset_name].size() > 0) { auto user_bbl_svg_list = wxGetApp().app_config->get_section("user_bbl_svg_list");
extra_map["bed_custom_texture"] = ConfigOptionString(user_bbl_svg_list[curr_preset_name]); if (user_bbl_svg_list.size() > 0 && user_bbl_svg_list[curr_preset_name].size() > 0) {
} extra_map["bed_custom_texture"] = ConfigOptionString(user_bbl_svg_list[curr_preset_name]);
else {
auto logo =wxGetApp().plater()->get_partplate_list().get_logo_texture_filename();
if (!logo.empty()) {
extra_map["bed_custom_texture"] = logo;
} }
} }
} }
auto bed_model_path = wxGetApp().plater()->get_partplate_list().get_bed3d()->get_model_filename(); else {//for cutom machine
if (!bed_model_path.empty()) { auto bed_model_path = wxGetApp().plater()->get_partplate_list().get_bed3d()->get_model_filename();
extra_map["bed_custom_model"] = bed_model_path; if (!bed_model_path.empty()) {
extra_map["bed_custom_model"] = bed_model_path;
}
auto logo = wxGetApp().plater()->get_partplate_list().get_logo_texture_filename();
if (!logo.empty()) {
extra_map["bed_custom_texture"] = logo;
}
} }
} }
bool exist_preset = false; bool exist_preset = false;