From d13e18a2385954a69f5c08dc85c0bb3c038bbd0d Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Fri, 25 Aug 2023 11:58:45 +0800 Subject: [PATCH] FIX: the position of wipe tower is not default when new project Jira: 4173 Change-Id: Icde5cac961eb225d2e703e8e87811b2940603126 --- src/slic3r/GUI/PartPlate.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 1f465dacc..6abe541be 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -2967,6 +2967,21 @@ void PartPlateList::init() m_plate_cols = 1; m_current_plate = 0; + if (m_plater) { + // In GUI mode + 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"); + wipe_tower_x->values.resize(m_plate_list.size(), wipe_tower_x->values.front()); + wipe_tower_y->values.resize(m_plate_list.size(), wipe_tower_y->values.front()); + + // set the default position, the same with print config(left top) + ConfigOptionFloat wt_x_opt(WIPE_TOWER_DEFAULT_X_POS); + ConfigOptionFloat wt_y_opt(WIPE_TOWER_DEFAULT_Y_POS); + dynamic_cast(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, 0, 0); + dynamic_cast(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, 0, 0); + } + select_plate(0); unprintable_plate.set_index(1);