Skip to content

Commit 31efc7e

Browse files
committed
Fix error when editing multifield values inside arrays and dictionaries
1 parent 4219ce9 commit 31efc7e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

editor/debugger/editor_debugger_inspector.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ void EditorDebuggerRemoteObjects::_get_property_list(List<PropertyInfo> *p_list)
9696
}
9797

9898
void EditorDebuggerRemoteObjects::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
99-
_set_impl(p_property, p_value, p_field);
99+
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
100+
Variant::Type type = p_value.get_type();
101+
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
102+
_set_impl(p_property, p_value, "");
103+
} else {
104+
_set_impl(p_property, p_value, p_field);
105+
}
100106
}
101107

102108
String EditorDebuggerRemoteObjects::get_title() {

editor/inspector/multi_node_edit.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,13 @@ StringName MultiNodeEdit::get_edited_class_name() const {
310310
}
311311

312312
void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
313-
_set_impl(p_property, p_value, p_field);
313+
// Ignore the field with arrays and dictionaries, as they are passed whole when edited.
314+
Variant::Type type = p_value.get_type();
315+
if (type == Variant::ARRAY || type == Variant::DICTIONARY) {
316+
_set_impl(p_property, p_value, "");
317+
} else {
318+
_set_impl(p_property, p_value, p_field);
319+
}
314320
}
315321

316322
void MultiNodeEdit::_bind_methods() {

0 commit comments

Comments
 (0)