From d426895580f137ee8fa5629d1290f9e8477a0fba Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 3 Jan 2019 09:12:50 +0100 Subject: [PATCH] Automatic selection of newly loaded objects --- src/slic3r/GUI/Plater.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 668c5559a..65ec044fd 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1503,6 +1503,17 @@ std::vector Plater::priv::load_files(const std::vector& input_ statusbar()->set_status_text(_(L("Loaded"))); } + // automatic selection of added objects + if (!obj_idxs.empty() && (view3D != nullptr)) + { + GLCanvas3D::Selection& selection = view3D->get_canvas3d()->get_selection(); + selection.clear(); + for (size_t idx : obj_idxs) + { + selection.add_object((unsigned int)idx, false); + } + } + return obj_idxs; }