From a6288503e940d337f3a21e809b0648e3a9f94208 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Sun, 23 Apr 2023 18:04:07 +0800 Subject: [PATCH] NEW: [STUDIO-2776] Display the number of selected parts The logic has been modified, please review again Change-Id: I777ea27b9a4fa5d4e2d1a5e01ea32a108f9a5196 (cherry picked from commit f85834dfbc223a72b3e131886fffada2e6cedaab) --- src/slic3r/GUI/Plater.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ff6296522..e97441c22 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -11344,11 +11344,18 @@ void Plater::show_object_info() { NotificationManager *notify_manager = get_notification_manager(); const Selection& selection = get_selection(); + int selCount = selection.get_volume_idxs().size(); ModelObjectPtrs objects = model().objects; int obj_idx = selection.get_object_idx(); std::string info_text; - if (objects.empty() || (obj_idx < 0) || (obj_idx >= objects.size()) || + if (selCount > 1) { + notify_manager->bbl_close_objectsinfo_notification(); + info_text += (boost::format(_utf8(L("Number of currently selected parts: %1%\n"))) % selCount).str(); + notify_manager->bbl_show_objectsinfo_notification(info_text, false, !(p->current_panel == p->view3D)); + return; + } + else if (objects.empty() || (obj_idx < 0) || (obj_idx >= objects.size()) || objects[obj_idx]->volumes.empty() ||// hack to avoid crash when deleting the last object on the bed (selection.is_single_full_object() && objects[obj_idx]->instances.size()> 1) || !(selection.is_single_full_instance() || selection.is_single_volume()))