Merge pull request #117214 from ryevdokimov/reset-follow-count

Reset follow mode focus count on selection change
This commit is contained in:
Thaddeus Crews 2026-03-09 15:18:26 -05:00
commit a1eaac8171
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
2 changed files with 9 additions and 0 deletions

View file

@ -3969,6 +3969,13 @@ void Node3DEditorViewport::_disable_follow_mode() {
times_focused_consecutively = 0;
}
void Node3DEditorViewport::_reset_follow_mode_count() {
bool is_in_follow_mode = times_focused_consecutively >= 2 && times_focused_consecutively % 2 == 0;
if (!is_in_follow_mode) {
times_focused_consecutively = 0;
}
}
void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
ERR_FAIL_COND(p_activate && !preview);
ERR_FAIL_COND(!p_activate && !previewing);
@ -5735,6 +5742,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
index = p_index;
editor_selection = EditorNode::get_singleton()->get_editor_selection();
editor_selection->connect("selection_changed", callable_mp(this, &Node3DEditorViewport::_reset_follow_mode_count));
message_time = 0;
zoom_indicator_delay = 0.0;

View file

@ -410,6 +410,7 @@ private:
void _preview_camera_property_changed();
void _update_centered_labels();
void _disable_follow_mode();
void _reset_follow_mode_count();
void _toggle_camera_preview(bool);
void _toggle_cinema_preview(bool);
void _init_gizmo_instance(int p_idx);