diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 3ee61f520377..e4a5ab86d92a 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2616,8 +2616,17 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, EditorIn } } - if (p_section) { - ep->connect("property_can_revert_changed", callable_mp(p_section, &EditorInspectorSection::property_can_revert_changed)); + Node *section_search = p_section; + while (section_search) { + EditorInspectorSection *section = Object::cast_to(section_search); + if (section) { + ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed)); + } + section_search = section_search->get_parent(); + if (Object::cast_to(section_search)) { + // Skip sub-resource inspectors. + break; + } } ep->set_read_only(read_only); @@ -3311,9 +3320,17 @@ void EditorInspector::update_tree() { } } - EditorInspectorSection *section = Object::cast_to(current_vbox->get_parent()); - if (section) { - ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed)); + Node *section_search = current_vbox->get_parent(); + while (section_search) { + EditorInspectorSection *section = Object::cast_to(section_search); + if (section) { + ep->connect("property_can_revert_changed", callable_mp(section, &EditorInspectorSection::property_can_revert_changed)); + } + section_search = section_search->get_parent(); + if (Object::cast_to(section_search)) { + // Skip sub-resource inspectors. + break; + } } ep->set_draw_warning(draw_warning);