Fix issue where editable children of 3D nodes would be selected

This commit is contained in:
Adam Scott 2024-09-09 14:17:42 -04:00
parent 27552a2f26
commit 9d735b0904
No known key found for this signature in database
GPG key ID: F6BA2A0302E21A77
2 changed files with 4 additions and 8 deletions

View file

@ -810,7 +810,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos) const {
Vector<Node3D *> nodes_with_gizmos = Node3DEditor::get_singleton()->gizmo_bvh_ray_query(pos, pos + ray * camera->get_far()); Vector<Node3D *> nodes_with_gizmos = Node3DEditor::get_singleton()->gizmo_bvh_ray_query(pos, pos + ray * camera->get_far());
for (Node3D *spat : nodes_with_gizmos) { for (Node3D *spat : nodes_with_gizmos) {
if (!spat) { if (!spat || _is_node_locked(spat)) {
continue; continue;
} }
@ -1557,7 +1557,7 @@ void Node3DEditorViewport::_surface_focus_exit() {
view_menu->set_disable_shortcuts(true); view_menu->set_disable_shortcuts(true);
} }
bool Node3DEditorViewport ::_is_node_locked(const Node *p_node) { bool Node3DEditorViewport::_is_node_locked(const Node *p_node) const {
return p_node->get_meta("_edit_lock_", false); return p_node->get_meta("_edit_lock_", false);
} }
@ -1935,11 +1935,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) { if (after != EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
// Single item selection. // Single item selection.
Vector<_RayResult> selection; clicked = _select_ray(b->get_position());
_find_items_at_pos(b->get_position(), selection, false);
if (!selection.is_empty()) {
clicked = selection[0].item->get_instance_id();
}
selection_in_progress = true; selection_in_progress = true;

View file

@ -460,7 +460,7 @@ private:
bool previewing_camera = false; bool previewing_camera = false;
bool previewing_cinema = false; bool previewing_cinema = false;
bool _is_node_locked(const Node *p_node); bool _is_node_locked(const Node *p_node) const;
void _preview_exited_scene(); void _preview_exited_scene();
void _toggle_camera_preview(bool); void _toggle_camera_preview(bool);
void _toggle_cinema_preview(bool); void _toggle_cinema_preview(bool);