X Tutup
Skip to content

Fix filtered objects getting unselected after reselection and certain properties change#109959

Closed
ryevdokimov wants to merge 1 commit intogodotengine:masterfrom
Open-Industry-Project:fix-filter-deletion
Closed

Fix filtered objects getting unselected after reselection and certain properties change#109959
ryevdokimov wants to merge 1 commit intogodotengine:masterfrom
Open-Industry-Project:fix-filter-deletion

Conversation

@ryevdokimov
Copy link
Contributor

This is a somewhat weird issue that I can only reliably reproduce in certain circumstances but sometimes can reproduce when just changing transforms for instantiate scenes. The fix is to suppress the filter removal unless the filter changes, to allow reselection without issues.

An example (note the conveyor getting unselected after I change the size property):

2025-08-25.17-43-01.mp4

With this PR the conveyor remains selected.

@ryevdokimov ryevdokimov requested a review from a team August 25, 2025 14:03
@KoBeWi KoBeWi added this to the 4.5 milestone Aug 25, 2025
@KoBeWi KoBeWi modified the milestones: 4.5, 4.6 Sep 9, 2025
Comment on lines +1694 to +1696
if (filter != p_filter) {
suppress_filter_removal = false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (filter != p_filter) {
suppress_filter_removal = false;
}
suppress_filter_removal = (filter == p_filter);

bool display_foreign = false;
bool tree_dirty = true;
bool pending_test_update = false;
bool suppress_filter_removal = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name could be improved. Maybe update_selection_from_filter? (with reversed logic)

@KoBeWi
Copy link
Member

KoBeWi commented Sep 9, 2025

The fix looks very hacky. The issue boils down to SceneTreeEditor changing EditorSelection when it shouldn't. E.g. updating configuration warnings will cause tree update, which calls filter update and deselects nodes if they are hidden.

tbh deselecting filtered out nodes seems so pointless now. What's the point if you can click the node in the viewport and it will be selected anyway, despite being invisible in the tree view? I wonder if we shouldn't just always keep the selection, so like #109963, but not optional.

@akien-mga
Copy link
Member

Superseded by #114569.

@akien-mga akien-mga closed this Jan 6, 2026
@akien-mga akien-mga removed this from the 4.6 milestone Jan 6, 2026
@ryevdokimov ryevdokimov deleted the fix-filter-deletion branch January 6, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup