From a7a01bfc7284efb09aa4c2d9cee7e0fd0a532874 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 6 Sep 2019 13:11:20 +0200 Subject: [PATCH] Keep selection after reload from disk --- src/slic3r/GUI/Plater.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 141b33d01e..4442c65e4a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3080,7 +3080,7 @@ void Plater::priv::reload_from_disk() { Plater::TakeSnapshot snapshot(q, _(L("Reload from Disk"))); - const auto &selection = get_selection(); + auto& selection = get_selection(); const auto obj_orig_idx = selection.get_object_idx(); if (selection.is_wipe_tower() || obj_orig_idx == -1) { return; } @@ -3107,6 +3107,14 @@ void Plater::priv::reload_from_disk() } remove(obj_orig_idx); + + // the previous call to remove() clears the selection + // select newly added objects + selection.clear(); + for (const auto idx : new_idxs) + { + selection.add_object((unsigned int)idx - 1, false); + } } void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* = -1*/)