From c6852a2d916e266c7e4c796511847688042c3449 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Mon, 13 Oct 2025 19:39:22 -0300 Subject: [PATCH] Don't show exported script variables twice in the remote inspector --- scene/debugger/scene_debugger.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index ae2e420ee40..557140b738f 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -751,7 +751,7 @@ SceneDebuggerObject::SceneDebuggerObject(Object *p_obj) { class_name = p_obj->get_class(); if (ScriptInstance *si = p_obj->get_script_instance()) { - // Read script instance constants and variables + // Read script instance constants and variables. if (!si->get_script().is_null()) { Script *s = si->get_script().ptr(); _parse_script_properties(s, si); @@ -815,9 +815,23 @@ void SceneDebuggerObject::_parse_script_properties(Script *p_script, ScriptInsta base = base->get_base_script(); } + HashSet exported_members; + + List pinfo; + p_instance->get_property_list(&pinfo); + for (const PropertyInfo &E : pinfo) { + if (E.usage & (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_CATEGORY)) { + exported_members.insert(E.name); + } + } + // Members for (KeyValue> sm : members) { for (const StringName &E : sm.value) { + if (exported_members.has(E)) { + continue; // Exported variables already show up in the inspector. + } + Variant m; if (p_instance->get(E, m)) { String script_path = sm.key == p_script ? "" : sm.key->get_path().get_file() + "/";