diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 5b9f2c3b21..76e09769cc 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -643,6 +643,19 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select bool keep = _item_matches_all_terms(p_parent, terms); p_parent->set_visible(keep_for_children || keep); + if (keep && !valid_types.is_empty()) { + keep = false; + Node *n = get_node(p_parent->get_metadata(0)); + + for (const StringName &E : valid_types) { + if (n->is_class(E) || + EditorNode::get_singleton()->is_object_of_custom_type(n, E)) { + keep = true; + break; + } + } + } + if (keep_for_children) { if (keep) { p_parent->clear_custom_color(0);