diff --git a/core/object/object.cpp b/core/object/object.cpp index 6d9315daeb63b..6abdba2e207f9 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -605,7 +605,8 @@ void Object::get_property_list(List *p_list, bool p_reversed) cons } for (const KeyValue &K : metadata) { - PropertyInfo pi = PropertyInfo(K.value.get_type(), "metadata/" + K.key.string()); + const uint32_t meta_usage = K.key.string().begins_with("_") ? PROPERTY_USAGE_NO_EDITOR : PROPERTY_USAGE_DEFAULT; + PropertyInfo pi = PropertyInfo(K.value.get_type(), "metadata/" + K.key.string(), PROPERTY_HINT_NONE, "", meta_usage); if (K.value.get_type() == Variant::OBJECT) { pi.hint = PROPERTY_HINT_RESOURCE_TYPE; Object *obj = K.value; diff --git a/editor/inspector/editor_inspector.cpp b/editor/inspector/editor_inspector.cpp index f9e832505c771..e7aa9e03fa945 100644 --- a/editor/inspector/editor_inspector.cpp +++ b/editor/inspector/editor_inspector.cpp @@ -132,7 +132,7 @@ bool EditorInspector::_resource_properties_matches(const Ref &p_resour continue; - } else if (p.name.begins_with("metadata/_") || !(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name) || + } else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name) || (p_filter.is_empty() && restrict_to_basic && !(p.usage & PROPERTY_USAGE_EDITOR_BASIC_SETTING))) { // Ignore properties that are not supposed to be in the inspector. continue; @@ -4584,8 +4584,7 @@ void EditorInspector::update_tree() { List::Element *N = E_property->next(); bool valid = true; while (N) { - if (!N->get().name.begins_with("metadata/_") && N->get().usage & PROPERTY_USAGE_EDITOR && - (!filter.is_empty() || !restrict_to_basic || (N->get().usage & PROPERTY_USAGE_EDITOR_BASIC_SETTING))) { + if (N->get().usage & PROPERTY_USAGE_EDITOR && (!filter.is_empty() || !restrict_to_basic || (N->get().usage & PROPERTY_USAGE_EDITOR_BASIC_SETTING))) { break; } // Treat custom categories as second-level ones. Do not skip a normal category if it is followed by a custom one. @@ -4657,7 +4656,7 @@ void EditorInspector::update_tree() { continue; - } else if (p.name.begins_with("metadata/_") || !(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name) || + } else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name) || (filter.is_empty() && restrict_to_basic && !(p.usage & PROPERTY_USAGE_EDITOR_BASIC_SETTING))) { // Ignore properties that are not supposed to be in the inspector. continue;