diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-21 11:28:59 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-21 11:28:59 +0100 |
commit | adf109d806442c392b0c81c6472a320c7ed9810c (patch) | |
tree | 6d610aae63e1c3dd1cfc3e8218c2eb9233f67cc0 /editor | |
parent | a58f6a9dd6dd86743134b838fd1c89f844bd961b (diff) | |
parent | 503d2d1cbf6cc632d7ea4f6bc54316e2a8284220 (diff) |
Merge pull request #71345 from reduz/support-metadata-multi-node-edit
Support metadata in MultiNodeEdit
Diffstat (limited to 'editor')
-rw-r--r-- | editor/multi_node_edit.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp index 2a55ac949f..4f0db70681 100644 --- a/editor/multi_node_edit.cpp +++ b/editor/multi_node_edit.cpp @@ -48,6 +48,8 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value, if (name == "scripts") { // Script set is intercepted at object level (check Variant Object::get()), so use a different name. name = "script"; + } else if (name.begins_with("Metadata/")) { + name = name.replace_first("Metadata/", "metadata/"); } Node *node_path_target = nullptr; @@ -98,6 +100,8 @@ bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name; if (name == "scripts") { // Script set is intercepted at object level (check Variant Object::get()), so use a different name. name = "script"; + } else if (name.begins_with("Metadata/")) { + name = name.replace_first("Metadata/", "metadata/"); } for (const NodePath &E : nodes) { @@ -137,14 +141,18 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const { List<PropertyInfo> plist; n->get_property_list(&plist, true); - for (const PropertyInfo &F : plist) { + for (PropertyInfo F : plist) { if (F.name == "script") { continue; // Added later manually, since this is intercepted before being set (check Variant Object::get()). + } else if (F.name.begins_with("metadata/")) { + F.name = F.name.replace_first("metadata/", "Metadata/"); // Trick to not get actual metadata edited from MultiNodeEdit. } + if (!usage.has(F.name)) { PLData pld; pld.uses = 0; pld.info = F; + pld.info.name = F.name; usage[F.name] = pld; data_list.push_back(usage.getptr(F.name)); } |