From 6c026234e3904370d6a0829ce1ffd7065d220f9c Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Fri, 13 Dec 2024 17:02:30 +0800 Subject: [PATCH] FIX:fix bug of model object in instance coordinates in move gizmo jira:STUDIO-9180 Change-Id: I5c637dcfd1b284c833102097d510af747fbf7769 (cherry picked from commit ab60fcae031c0a6ce548021d5d2c16a82f67df2d) --- src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp index d5f25146ba..4fbefb81e5 100644 --- a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp +++ b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp @@ -123,6 +123,9 @@ void GizmoObjectManipulation::update_settings_value(const Selection &selection) else {//if (is_local_coordinates()) {//for scale auto tran = selection.get_first_volume()->get_instance_transformation(); m_new_position = tran.get_matrix().inverse() * cs_center; + if (is_instance_coordinates()) { + m_new_position = Vec3d::Zero(); + } m_new_size = selection.get_bounding_box_in_current_reference_system().first.size(); m_unscale_size = selection.get_full_unscaled_instance_local_bounding_box().size(); m_new_scale = m_new_size.cwiseQuotient(m_unscale_size) * 100.0; @@ -886,7 +889,13 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper, index = 1; index_unit = 1; ImGui::AlignTextToFramePadding(); - imgui_wrapper->text(_L("Position")); + if (selection.is_single_full_instance() && is_instance_coordinates()) { + imgui_wrapper->text(_L("Translate(Relative)")); + } + else { + imgui_wrapper->text(_L("Position")); + } + ImGui::SameLine(caption_max + index * space_size); ImGui::PushItemWidth(unit_size); ImGui::BBLInputDouble(label_values[0][0], &display_position[0], 0.0f, 0.0f, "%.2f");