From 47dc4bc3072208b973d2a0d26c8f9502e09c7f40 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 8 Mar 2023 06:14:34 -0500 Subject: Don't unset local_coords on starting transform. This fixes a bug introduced by 806425621cfa3daba3ba9f6b020726490a3152a4, where dragging the gizmo no longer respected local transforms. I'm not sure why I called set_local_coords_enabled(false) in _compute_edit. Removing this line seems to fix gizmo-dragging local transforms, without breaking anything else. I also noticed that confirming a transform leaves the gizmo axis lines on the screen. This is fixed by calling update_transform_gizmo after clearing the edit mode/instant flags, so update_transform_gizmo knows not to render any axes. (cherry picked from commit d3d1223b970140b6a37d0c23e3b234c878be510a) --- editor/plugins/node_3d_editor_plugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 7c1f54dc61..333771ceb4 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1110,7 +1110,6 @@ void Node3DEditorViewport::_compute_edit(const Point2 &p_point) { _edit.click_ray = _get_ray(p_point); _edit.click_ray_pos = _get_ray_pos(p_point); _edit.plane = TRANSFORM_VIEW; - spatial_editor->set_local_coords_enabled(false); spatial_editor->update_transform_gizmo(); _edit.center = spatial_editor->get_gizmo_transform().origin; @@ -4861,9 +4860,9 @@ void Node3DEditorViewport::update_transform(Point2 p_mousepos, bool p_shift) { void Node3DEditorViewport::finish_transform() { spatial_editor->set_local_coords_enabled(_edit.original_local); - spatial_editor->update_transform_gizmo(); _edit.mode = TRANSFORM_NONE; _edit.instant = false; + spatial_editor->update_transform_gizmo(); surface->queue_redraw(); } -- cgit v1.2.3