diff --git a/core/object/object.h b/core/object/object.h
index 7bee1c74551..7b7dbd4c32d 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -93,7 +93,7 @@ enum PropertyHint {
PROPERTY_HINT_TOOL_BUTTON,
PROPERTY_HINT_ONESHOT, ///< the property will be changed by self after setting, such as AudioStreamPlayer.playing, Particles.emitting.
PROPERTY_HINT_NO_NODEPATH, /// < this property will not contain a NodePath, regardless of type (Array, Dictionary, List, etc.). Needed for SceneTreeDock.
- PROPERTY_HINT_GROUP_ENABLE, ///< used to make the property's group checkable. Only use for boolean types.
+ PROPERTY_HINT_GROUP_ENABLE, ///< used to make the property's group checkable. Only use for boolean types. Optional "feature" hint string force hides anything inside when unchecked.
PROPERTY_HINT_INPUT_NAME,
PROPERTY_HINT_MAX,
};
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 6afdf5f6f6d..9a0564d7a0b 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -2958,7 +2958,8 @@
Hints that a property will be changed on its own after setting, such as [member AudioStreamPlayer.playing] or [member GPUParticles3D.emitting].
- Hints that a boolean property will enable the feature associated with the group that it occurs in. Only works within a group or subgroup.
+ Hints that a boolean property will enable the feature associated with the group that it occurs in. Only works within a group or subgroup. Use the optional hint string [code]"feature"[/code] when the group only has variables that are meaningful when the feature is enabled.
+ [b]Note:[/b] The [code]"feature"[/code] hint string does not modify or reset any values.
Hints that a [String] or [StringName] property is the name of an input action. This allows the selection of any action name from the Input Map in the Project Settings. The hint string may contain two options separated by commas:
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 0b2d0280899..d52e513c7f6 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1827,7 +1827,7 @@ void EditorInspectorSection::_notification(int p_what) {
header_offset_x += section_indent;
}
- bool has_children_to_show = vbox->get_child_count(false) != 0;
+ bool can_click_unfold = vbox->get_child_count(false) != 0 && !(checkable && !checked && hide_feature);
// Draw header area.
int header_height = _get_header_height();
@@ -1835,7 +1835,7 @@ void EditorInspectorSection::_notification(int p_what) {
Color c = bg_color;
c.a *= 0.4;
if (foldable && header_rect.has_point(get_local_mouse_position())) {
- c = c.lightened((has_children_to_show && Input::get_singleton()->is_mouse_button_pressed(MouseButton::LEFT)) ? -0.05 : 0.2);
+ c = c.lightened((can_click_unfold && Input::get_singleton()->is_mouse_button_pressed(MouseButton::LEFT)) ? -0.05 : 0.2);
}
draw_rect(header_rect, c);
@@ -1857,32 +1857,52 @@ void EditorInspectorSection::_notification(int p_what) {
arrow_position.x = margin_start;
}
arrow_position.y = (header_height - arrow->get_height()) / 2;
- if (has_children_to_show) {
+ if (can_click_unfold) {
draw_texture(arrow, arrow_position);
}
margin_start += arrow->get_width() + separation;
}
+ Ref font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
+ int font_size = get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
+
+ Ref light_font = get_theme_font(SNAME("main"), EditorStringName(EditorFonts));
+ int light_font_size = get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts));
+
// - Checkbox.
Ref checkbox = _get_checkbox();
if (checkbox.is_valid()) {
+ const String checkbox_text = TTR("On");
+ Size2 label_size = light_font->get_string_size(checkbox_text, HORIZONTAL_ALIGNMENT_LEFT, -1.0f, light_font_size);
Point2 checkbox_position;
+ Point2 label_position;
if (rtl) {
- checkbox_position.x = margin_start;
+ label_position.x = margin_start;
+ checkbox_position.x = margin_start + label_size.width + 2 * EDSCALE;
} else {
- checkbox_position.x = get_size().width - (margin_end + checkbox->get_width());
+ label_position.x = get_size().width - (margin_end + label_size.width);
+ checkbox_position.x = label_position.x - checkbox->get_width() - 2 * EDSCALE;
}
checkbox_position.y = (header_height - checkbox->get_height()) / 2;
- check_rect = Rect2(checkbox_position.x, checkbox_position.y, checkbox->get_width(), checkbox->get_height());
+ label_position.y = light_font->get_ascent(light_font_size) + (header_height - label_size.height) / 2.0;
+ check_rect = Rect2(checkbox_position.x, 0, checkbox->get_width() + label_size.width + 2 * EDSCALE, header_height);
+
+ Color check_font_color = font_color;
Color checkbox_color(1, 1, 1);
if (check_hover) {
checkbox_color.r *= 1.2;
checkbox_color.g *= 1.2;
checkbox_color.b *= 1.2;
+ check_font_color = checked ? get_theme_color(SNAME("font_hover_pressed_color"), EditorStringName(Editor)) : get_theme_color(SNAME("font_hover_color"), EditorStringName(Editor));
+ } else if (checked) {
+ check_font_color = get_theme_color(SNAME("font_pressed_color"), EditorStringName(Editor));
}
+
draw_texture(checkbox, checkbox_position, checkbox_color);
- margin_end += checkbox->get_width() + 4 * EDSCALE;
+ draw_string(light_font, label_position, checkbox_text, HORIZONTAL_ALIGNMENT_LEFT, -1.0f, light_font_size, check_font_color, TextServer::JUSTIFICATION_NONE);
+ margin_end += label_size.width + checkbox->get_width() + 6 * EDSCALE;
}
int available = get_size().width - (margin_start + margin_end);
@@ -1891,22 +1911,10 @@ void EditorInspectorSection::_notification(int p_what) {
String num_revertable_str;
int num_revertable_width = 0;
- bool folded = foldable && !object->editor_is_section_unfolded(section);
-
- Ref font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
- int font_size = get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
- Color font_color;
- if (object->has_method("_get_property_warning")) {
- font_color = get_theme_color(String(object->call("_get_property_warning", related_enable_property)).is_empty() ? SceneStringName(font_color) : SNAME("warning_color"), EditorStringName(Editor));
- } else {
- font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
- }
-
+ bool folded = (foldable || hide_feature) && !object->editor_is_section_unfolded(section);
if (folded && revertable_properties.size()) {
int label_width = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, available, font_size, TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS).x;
- Ref light_font = get_theme_font(SNAME("main"), EditorStringName(EditorFonts));
- int light_font_size = get_theme_font_size(SNAME("main_size"), EditorStringName(EditorFonts));
Color light_font_color = get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor));
// Can we fit the long version of the revertable count text?
@@ -1934,6 +1942,9 @@ void EditorInspectorSection::_notification(int p_what) {
if (rtl) {
text_offset.x = margin_end;
}
+ if (object->has_method("_get_property_warning") && !String(object->call("_get_property_warning", related_enable_property)).is_empty()) {
+ font_color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
+ }
HorizontalAlignment text_align = rtl ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT;
draw_string(font, text_offset, label, text_align, available, font_size, font_color, TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS);
}
@@ -2084,7 +2095,7 @@ void EditorInspectorSection::gui_input(const Ref &p_event) {
Ref k = p_event;
if (k.is_valid() && k->is_pressed()) {
- if (foldable && has_children_to_show && k->is_action("ui_accept", true)) {
+ if (foldable && has_children_to_show && !(checkable && !checked && hide_feature) && k->is_action("ui_accept", true)) {
accept_event();
bool should_unfold = !object->editor_is_section_unfolded(section);
@@ -2108,12 +2119,16 @@ void EditorInspectorSection::gui_input(const Ref &p_event) {
accept_event();
- if (check_rect.has_point(mb->get_position())) {
+ if (checkable && check_rect.has_point(mb->get_position())) {
checked = !checked;
emit_signal(SNAME("section_toggled_by_user"), related_enable_property, checked);
- unfold();
+ if (checked) {
+ unfold();
+ } else if (hide_feature) {
+ fold();
+ }
} else if (foldable) {
- bool should_unfold = has_children_to_show && !object->editor_is_section_unfolded(section);
+ bool should_unfold = has_children_to_show && !(checkable && !checked && hide_feature) && !object->editor_is_section_unfolded(section);
if (should_unfold) {
unfold();
} else {
@@ -2151,7 +2166,7 @@ void EditorInspectorSection::_accessibility_action_expand(const Variant &p_data)
}
void EditorInspectorSection::unfold() {
- if (!foldable) {
+ if (!foldable && !hide_feature) {
return;
}
@@ -2163,7 +2178,7 @@ void EditorInspectorSection::unfold() {
}
void EditorInspectorSection::fold() {
- if (!foldable) {
+ if (!foldable && !hide_feature) {
return;
}
@@ -2187,23 +2202,32 @@ void EditorInspectorSection::reset_timer() {
}
}
-void EditorInspectorSection::set_checkable(const String &p_related_check_property) {
+void EditorInspectorSection::set_checkable(const String &p_related_check_property, bool p_hide_feature) {
if (checkable == !p_related_check_property.is_empty()) {
return;
}
+ hide_feature = p_hide_feature;
checkable = !p_related_check_property.is_empty();
related_enable_property = p_related_check_property;
queue_redraw();
+
+ if (InspectorDock::get_singleton()) {
+ if (checkable) {
+ InspectorDock::get_inspector_singleton()->connect("property_edited", callable_mp(this, &EditorInspectorSection::_property_edited));
+ } else {
+ InspectorDock::get_inspector_singleton()->disconnect("property_edited", callable_mp(this, &EditorInspectorSection::_property_edited));
+ }
+ }
}
void EditorInspectorSection::set_checked(bool p_checked) {
- if (checked == p_checked) {
- return;
- }
-
checked = p_checked;
- queue_redraw();
+ if (hide_feature && !checked) {
+ fold();
+ } else {
+ unfold();
+ }
}
bool EditorInspectorSection::has_revertable_properties() const {
@@ -2222,6 +2246,17 @@ void EditorInspectorSection::property_can_revert_changed(const String &p_path, b
}
}
+void EditorInspectorSection::_property_edited(const String &p_property) {
+ if (!related_enable_property.is_empty() && p_property == related_enable_property) {
+ bool valid = false;
+ Variant value_checked = object->get(related_enable_property, &valid);
+
+ if (valid) {
+ set_checked(value_checked.operator bool());
+ }
+ }
+}
+
void EditorInspectorSection::_bind_methods() {
ClassDB::bind_method(D_METHOD("setup", "section", "label", "object", "bg_color", "foldable", "indent_depth", "level"), &EditorInspectorSection::setup, DEFVAL(0), DEFVAL(1));
ClassDB::bind_method(D_METHOD("get_vbox"), &EditorInspectorSection::get_vbox);
@@ -2247,6 +2282,10 @@ EditorInspectorSection::~EditorInspectorSection() {
if (!vbox_added) {
memdelete(vbox);
}
+
+ if (checkable && InspectorDock::get_singleton()) {
+ InspectorDock::get_inspector_singleton()->disconnect("property_edited", callable_mp(this, &EditorInspectorSection::_property_edited));
+ }
}
////////////////////////////////////////////////
@@ -3461,8 +3500,10 @@ void EditorInspector::update_tree() {
String filter = search_box ? search_box->get_text() : "";
String group;
String group_base;
+ EditorInspectorSection *group_togglable_property = nullptr;
String subgroup;
String subgroup_base;
+ EditorInspectorSection *subgroup_togglable_property = nullptr;
int section_depth = 0;
bool disable_favorite = false;
VBoxContainer *category_vbox = nullptr;
@@ -3473,6 +3514,7 @@ void EditorInspector::update_tree() {
HashMap> vbox_per_path;
HashMap editor_inspector_array_per_prefix;
HashMap>> favorites_to_add;
+ HashMap togglable_editor_inspector_sections;
Color sscolor = get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
bool sub_inspectors_enabled = EDITOR_GET("interface/inspector/open_resources_in_current_inspector");
@@ -3496,6 +3538,7 @@ void EditorInspector::update_tree() {
if (p.usage & PROPERTY_USAGE_SUBGROUP) {
// Setup a property sub-group.
subgroup = p.name;
+ subgroup_togglable_property = nullptr;
Vector hint_parts = p.hint_string.split(",");
subgroup_base = hint_parts[0];
@@ -3510,6 +3553,7 @@ void EditorInspector::update_tree() {
} else if (p.usage & PROPERTY_USAGE_GROUP) {
// Setup a property group.
group = p.name;
+ group_togglable_property = nullptr;
Vector hint_parts = p.hint_string.split(",");
group_base = hint_parts[0];
@@ -3521,6 +3565,7 @@ void EditorInspector::update_tree() {
subgroup = "";
subgroup_base = "";
+ subgroup_togglable_property = nullptr;
continue;
@@ -3528,8 +3573,10 @@ void EditorInspector::update_tree() {
// Setup a property category.
group = "";
group_base = "";
+ group_togglable_property = nullptr;
subgroup = "";
subgroup_base = "";
+ subgroup_togglable_property = nullptr;
section_depth = 0;
disable_favorite = false;
@@ -3710,6 +3757,7 @@ void EditorInspector::update_tree() {
// Keep it, this is used pretty often.
} else {
subgroup = ""; // The prefix changed, we are no longer in the subgroup.
+ subgroup_togglable_property = nullptr;
}
}
@@ -3721,7 +3769,9 @@ void EditorInspector::update_tree() {
// Keep it, this is used pretty often.
} else {
group = ""; // The prefix changed, we are no longer in the group.
+ group_togglable_property = nullptr;
subgroup = "";
+ subgroup_togglable_property = nullptr;
}
}
@@ -4034,9 +4084,7 @@ void EditorInspector::update_tree() {
F = dd->class_list.find(F->value.inherits);
}
}
- }
- if (use_doc_hints) {
// `|` separators used in `EditorHelpBit`.
if (theme_item_name.is_empty()) {
if (p.name.contains("shader_parameter/")) {
@@ -4063,9 +4111,15 @@ void EditorInspector::update_tree() {
Variant value_checked = object->get(p.name, &valid);
if (valid) {
- last_created_section->set_checkable(p.name);
+ last_created_section->set_checkable(p.name, p.hint_string == "feature");
last_created_section->set_checked(value_checked.operator bool());
+ if (p.name.begins_with(group_base)) {
+ group_togglable_property = last_created_section;
+ } else {
+ subgroup_togglable_property = last_created_section;
+ }
+
if (use_doc_hints) {
last_created_section->set_tooltip_text(doc_tooltip_text);
}
@@ -4149,19 +4203,6 @@ void EditorInspector::update_tree() {
}
}
- 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;
- }
- }
-
if (p.name.begins_with("metadata/")) {
Variant _default = Variant();
if (node != nullptr) {
@@ -4184,8 +4225,30 @@ void EditorInspector::update_tree() {
if (ep && ep->is_favoritable() && current_favorites.has(p.name)) {
ep->favorited = true;
favorites_to_add[group][subgroup].push_back(ep);
+
+ if (group_togglable_property) {
+ togglable_editor_inspector_sections[group] = group_togglable_property;
+ }
+ if (subgroup_togglable_property) {
+ togglable_editor_inspector_sections[group + "/" + subgroup] = subgroup_togglable_property;
+ }
} else {
current_vbox->add_child(editors[i].property_editor);
+
+ if (ep) {
+ 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;
+ }
+ }
+ }
}
if (ep) {
@@ -4248,6 +4311,23 @@ void EditorInspector::update_tree() {
parent_vbox = section->get_vbox();
section->setup("", section_name, object, sscolor, false);
section->set_tooltip_text(tooltip);
+
+ if (togglable_editor_inspector_sections.has(section_name)) {
+ EditorInspectorSection *corresponding_section = togglable_editor_inspector_sections.get(section_name);
+
+ bool valid = false;
+ Variant value_checked = object->get(corresponding_section->related_enable_property, &valid);
+ if (valid) {
+ section->section = corresponding_section->section;
+ section->set_checkable(corresponding_section->related_enable_property, corresponding_section->hide_feature);
+ section->set_checked(value_checked.operator bool());
+ if (use_doc_hints) {
+ section->set_tooltip_text(corresponding_section->get_tooltip_text());
+ }
+
+ section->connect("section_toggled_by_user", callable_mp(this, &EditorInspector::_section_toggled_by_user));
+ }
+ }
}
for (const KeyValue> &KV2 : KV.value) {
@@ -4268,11 +4348,41 @@ void EditorInspector::update_tree() {
vbox = section->get_vbox();
section->setup("", section_name, object, sscolor, false);
section->set_tooltip_text(tooltip);
+
+ if (togglable_editor_inspector_sections.has(KV.key + "/" + section_name)) {
+ EditorInspectorSection *corresponding_section = togglable_editor_inspector_sections.get(KV.key + "/" + section_name);
+
+ bool valid = false;
+ Variant value_checked = object->get(corresponding_section->related_enable_property, &valid);
+ if (valid) {
+ section->section = corresponding_section->section;
+ section->set_checkable(corresponding_section->related_enable_property, corresponding_section->hide_feature);
+ section->set_checked(value_checked.operator bool());
+ if (use_doc_hints) {
+ section->set_tooltip_text(corresponding_section->get_tooltip_text());
+ }
+
+ section->connect("section_toggled_by_user", callable_mp(this, &EditorInspector::_section_toggled_by_user));
+ }
+ }
}
for (EditorProperty *ep : KV2.value) {
vbox->add_child(ep);
+ Node *section_search = 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;
+ }
+ }
+
// Now that it's inside the tree, do the setup.
ep->update_property();
ep->_update_flags();
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index a0da16593a3..04d7a53eb14 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -333,6 +333,8 @@ public:
class EditorInspectorSection : public Container {
GDCLASS(EditorInspectorSection, Container);
+ friend class EditorInspector;
+
String label;
String section;
Color bg_color;
@@ -350,6 +352,8 @@ class EditorInspectorSection : public Container {
Rect2 check_rect;
bool check_hover = false;
+ bool hide_feature = false;
+
HashSet revertable_properties;
void _test_unfold();
@@ -382,11 +386,12 @@ public:
void fold();
void set_bg_color(const Color &p_bg_color);
void reset_timer();
- void set_checkable(const String &p_related_check_property);
+ void set_checkable(const String &p_related_check_property, bool p_hide_feature);
void set_checked(bool p_checked);
bool has_revertable_properties() const;
void property_can_revert_changed(const String &p_path, bool p_can_revert);
+ void _property_edited(const String &p_property);
EditorInspectorSection();
~EditorInspectorSection();
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp
index b2bb56cf70e..f3c74a53337 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -567,7 +567,6 @@ void Camera2D::set_limit_enabled(bool p_limit_enabled) {
#ifdef TOOLS_ENABLED
emit_signal("_camera_limit_enabled_updated"); // Used for Camera2DEditorPlugin.
#endif
- notify_property_list_changed();
}
bool Camera2D::is_limit_enabled() const {
@@ -789,7 +788,6 @@ void Camera2D::set_rotation_smoothing_enabled(bool p_enabled) {
return;
}
rotation_smoothing_enabled = p_enabled;
- notify_property_list_changed();
}
bool Camera2D::is_rotation_smoothing_enabled() const {
@@ -858,7 +856,6 @@ void Camera2D::set_position_smoothing_enabled(bool p_enabled) {
return;
}
position_smoothing_enabled = p_enabled;
- notify_property_list_changed();
}
bool Camera2D::is_position_smoothing_enabled() const {
@@ -936,18 +933,6 @@ bool Camera2D::is_margin_drawing_enabled() const {
return margin_drawing_enabled;
}
-void Camera2D::_validate_property(PropertyInfo &p_property) const {
- if (!limit_enabled && (p_property.name == "limit_smoothed" || p_property.name == "limit_left" || p_property.name == "limit_top" || p_property.name == "limit_right" || p_property.name == "limit_bottom")) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
- if (!position_smoothing_enabled && p_property.name == "position_smoothing_speed") {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
- if (!rotation_smoothing_enabled && p_property.name == "rotation_smoothing_speed") {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-}
-
void Camera2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_offset", "offset"), &Camera2D::set_offset);
ClassDB::bind_method(D_METHOD("get_offset"), &Camera2D::get_offset);
@@ -1037,7 +1022,7 @@ void Camera2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_callback", "get_process_callback");
ADD_GROUP("Limit", "limit_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "limit_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_limit_enabled", "is_limit_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "limit_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_limit_enabled", "is_limit_enabled");
ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_left", PROPERTY_HINT_NONE, "suffix:px"), "set_limit", "get_limit", SIDE_LEFT);
ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_top", PROPERTY_HINT_NONE, "suffix:px"), "set_limit", "get_limit", SIDE_TOP);
ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_right", PROPERTY_HINT_NONE, "suffix:px"), "set_limit", "get_limit", SIDE_RIGHT);
@@ -1045,11 +1030,11 @@ void Camera2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "limit_smoothed"), "set_limit_smoothing_enabled", "is_limit_smoothing_enabled");
ADD_GROUP("Position Smoothing", "position_smoothing_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "position_smoothing_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_position_smoothing_enabled", "is_position_smoothing_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "position_smoothing_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_position_smoothing_enabled", "is_position_smoothing_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "position_smoothing_speed", PROPERTY_HINT_NONE, "suffix:px/s"), "set_position_smoothing_speed", "get_position_smoothing_speed");
ADD_GROUP("Rotation Smoothing", "rotation_smoothing_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotation_smoothing_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_rotation_smoothing_enabled", "is_rotation_smoothing_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotation_smoothing_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_rotation_smoothing_enabled", "is_rotation_smoothing_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rotation_smoothing_speed"), "set_rotation_smoothing_speed", "get_rotation_smoothing_speed");
ADD_GROUP("Drag", "drag_");
diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h
index 70de9614caf..392e7b46df6 100644
--- a/scene/2d/camera_2d.h
+++ b/scene/2d/camera_2d.h
@@ -122,7 +122,6 @@ protected:
void _notification(int p_what);
static void _bind_methods();
- void _validate_property(PropertyInfo &p_property) const;
public:
#ifdef TOOLS_ENABLED
diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp
index e8250e2f8fd..647b36fa731 100644
--- a/scene/2d/gpu_particles_2d.cpp
+++ b/scene/2d/gpu_particles_2d.cpp
@@ -960,7 +960,7 @@ void GPUParticles2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates");
ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime,Reverse Lifetime"), "set_draw_order", "get_draw_order");
ADD_GROUP("Trails", "trail_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "trail_enabled"), "set_trail_enabled", "is_trail_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "trail_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_trail_enabled", "is_trail_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "trail_lifetime", PROPERTY_HINT_RANGE, "0.01,10,0.01,or_greater,suffix:s"), "set_trail_lifetime", "get_trail_lifetime");
ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_sections", PROPERTY_HINT_RANGE, "2,128,1"), "set_trail_sections", "get_trail_sections");
ADD_PROPERTY(PropertyInfo(Variant::INT, "trail_section_subdivisions", PROPERTY_HINT_RANGE, "1,1024,1"), "set_trail_section_subdivisions", "get_trail_section_subdivisions");
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index cbb8773f5ff..e19dd6c80ae 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -161,7 +161,6 @@ int Light2D::get_item_shadow_cull_mask() const {
void Light2D::set_shadow_enabled(bool p_enabled) {
shadow = p_enabled;
RS::get_singleton()->canvas_light_set_shadow_enabled(canvas_light, shadow);
- notify_property_list_changed();
}
bool Light2D::is_shadow_enabled() const {
@@ -244,10 +243,6 @@ real_t Light2D::get_shadow_smooth() const {
}
void Light2D::_validate_property(PropertyInfo &p_property) const {
- if (!shadow && (p_property.name == "shadow_color" || p_property.name == "shadow_filter" || p_property.name == "shadow_filter_smooth" || p_property.name == "shadow_item_cull_mask")) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-
if (shadow && p_property.name == "shadow_filter_smooth" && shadow_filter == SHADOW_FILTER_NONE) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
@@ -315,7 +310,7 @@ void Light2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "range_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_cull_mask", "get_item_cull_mask");
ADD_GROUP("Shadow", "shadow_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_shadow_enabled", "is_shadow_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_shadow_enabled", "is_shadow_enabled");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color");
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_filter", PROPERTY_HINT_ENUM, "None (Fast),PCF5 (Average),PCF13 (Slow)"), "set_shadow_filter", "get_shadow_filter");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth");
diff --git a/scene/2d/physics/collision_polygon_2d.cpp b/scene/2d/physics/collision_polygon_2d.cpp
index e84bd123403..2d5e975c5c6 100644
--- a/scene/2d/physics/collision_polygon_2d.cpp
+++ b/scene/2d/physics/collision_polygon_2d.cpp
@@ -308,7 +308,9 @@ void CollisionPolygon2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "build_mode", PROPERTY_HINT_ENUM, "Solids,Segments"), "set_build_mode", "get_build_mode");
ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
+
+ ADD_GROUP("One Way Collision", "one_way_collision");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_one_way_collision", "is_one_way_collision_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1,suffix:px"), "set_one_way_collision_margin", "get_one_way_collision_margin");
BIND_ENUM_CONSTANT(BUILD_SOLIDS);
diff --git a/scene/2d/physics/collision_shape_2d.cpp b/scene/2d/physics/collision_shape_2d.cpp
index ae02e313f43..840052831be 100644
--- a/scene/2d/physics/collision_shape_2d.cpp
+++ b/scene/2d/physics/collision_shape_2d.cpp
@@ -286,7 +286,8 @@ void CollisionShape2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape2D"), "set_shape", "get_shape");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
+ ADD_GROUP("One Way Collision", "one_way_collision");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_way_collision", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_one_way_collision", "is_one_way_collision_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "one_way_collision_margin", PROPERTY_HINT_RANGE, "0,128,0.1,suffix:px"), "set_one_way_collision_margin", "get_one_way_collision_margin");
ClassDB::bind_method(D_METHOD("set_debug_color", "color"), &CollisionShape2D::set_debug_color);
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index f7420bdea4e..f3fa22882b6 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -102,12 +102,6 @@ bool Polygon2D::_edit_is_selected_on_click(const Point2 &p_point, double p_toler
}
#endif // DEBUG_ENABLED
-void Polygon2D::_validate_property(PropertyInfo &p_property) const {
- if (!invert && p_property.name == "invert_border") {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-}
-
void Polygon2D::_skeleton_bone_setup_changed() {
queue_redraw();
}
@@ -505,7 +499,6 @@ Size2 Polygon2D::get_texture_scale() const {
void Polygon2D::set_invert(bool p_invert) {
invert = p_invert;
queue_redraw();
- notify_property_list_changed();
}
bool Polygon2D::get_invert() const {
@@ -718,7 +711,7 @@ void Polygon2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "skeleton", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Skeleton2D"), "set_skeleton", "get_skeleton");
ADD_GROUP("Invert", "invert_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "invert_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_invert_enabled", "get_invert_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "invert_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_invert_enabled", "get_invert_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "invert_border", PROPERTY_HINT_RANGE, "0.1,16384,0.1,suffix:px"), "set_invert_border", "get_invert_border");
ADD_GROUP("Data", "");
diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h
index 8281762958c..af7f20f484f 100644
--- a/scene/2d/polygon_2d.h
+++ b/scene/2d/polygon_2d.h
@@ -79,7 +79,6 @@ class Polygon2D : public Node2D {
protected:
void _notification(int p_what);
static void _bind_methods();
- void _validate_property(PropertyInfo &p_property) const;
public:
#ifdef TOOLS_ENABLED
diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp
index efe3cfae1b7..6f334e50959 100644
--- a/scene/2d/sprite_2d.cpp
+++ b/scene/2d/sprite_2d.cpp
@@ -257,7 +257,6 @@ void Sprite2D::set_region_enabled(bool p_region_enabled) {
region_enabled = p_region_enabled;
_emit_region_rect_enabled();
queue_redraw();
- notify_property_list_changed();
}
bool Sprite2D::is_region_enabled() const {
@@ -462,10 +461,6 @@ void Sprite2D::_validate_property(PropertyInfo &p_property) const {
if (p_property.name == "frame_coords") {
p_property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
}
-
- if (!region_enabled && (p_property.name == "region_rect" || p_property.name == "region_filter_clip_enabled")) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
}
void Sprite2D::_texture_changed() {
@@ -537,7 +532,7 @@ void Sprite2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "frame_coords", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_frame_coords", "get_frame_coords");
ADD_GROUP("Region", "region_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_region_enabled", "is_region_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_region_enabled", "is_region_enabled");
ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "region_filter_clip_enabled"), "set_region_filter_clip_enabled", "is_region_filter_clip_enabled");
}
diff --git a/scene/2d/tile_map_layer.cpp b/scene/2d/tile_map_layer.cpp
index 6665c17378e..371d4749b4b 100644
--- a/scene/2d/tile_map_layer.cpp
+++ b/scene/2d/tile_map_layer.cpp
@@ -2188,8 +2188,8 @@ void TileMapLayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_visibility_mode", PROPERTY_HINT_ENUM, "Default,Force Show,Force Hide"), "set_collision_visibility_mode", "get_collision_visibility_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "physics_quadrant_size"), "set_physics_quadrant_size", "get_physics_quadrant_size");
#ifndef NAVIGATION_2D_DISABLED
- ADD_GROUP("Navigation", "");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "navigation_enabled"), "set_navigation_enabled", "is_navigation_enabled");
+ ADD_GROUP("Navigation", "navigation_");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "navigation_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_navigation_enabled", "is_navigation_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_visibility_mode", PROPERTY_HINT_ENUM, "Default,Force Show,Force Hide"), "set_navigation_visibility_mode", "get_navigation_visibility_mode");
#endif // NAVIGATION_2D_DISABLED
diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp
index 4ed17df02f1..44bad21be59 100644
--- a/scene/3d/gpu_particles_3d.cpp
+++ b/scene/3d/gpu_particles_3d.cpp
@@ -842,7 +842,7 @@ void GPUParticles3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime,Reverse Lifetime,View Depth"), "set_draw_order", "get_draw_order");
ADD_PROPERTY(PropertyInfo(Variant::INT, "transform_align", PROPERTY_HINT_ENUM, "Disabled,Z-Billboard,Y to Velocity,Z-Billboard + Y to Velocity"), "set_transform_align", "get_transform_align");
ADD_GROUP("Trails", "trail_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "trail_enabled"), "set_trail_enabled", "is_trail_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "trail_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_trail_enabled", "is_trail_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "trail_lifetime", PROPERTY_HINT_RANGE, "0.01,10,0.01,or_greater,suffix:s"), "set_trail_lifetime", "get_trail_lifetime");
ADD_GROUP("Process Material", "");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "process_material", PROPERTY_HINT_RESOURCE_TYPE, "ParticleProcessMaterial,ShaderMaterial"), "set_process_material", "get_process_material");
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp
index b52347b729c..48163d7eec2 100644
--- a/scene/3d/light_3d.cpp
+++ b/scene/3d/light_3d.cpp
@@ -56,7 +56,6 @@ void Light3D::set_shadow(bool p_enable) {
shadow = p_enable;
RS::get_singleton()->light_set_shadow(light, p_enable);
- notify_property_list_changed();
update_configuration_warnings();
}
@@ -323,10 +322,6 @@ bool Light3D::is_editor_only() const {
}
void Light3D::_validate_property(PropertyInfo &p_property) const {
- if (!shadow && (p_property.name == "shadow_bias" || p_property.name == "shadow_normal_bias" || p_property.name == "shadow_reverse_cull_face" || p_property.name == "shadow_transmittance_bias" || p_property.name == "shadow_opacity" || p_property.name == "shadow_blur" || p_property.name == "distance_fade_shadow" || p_property.name == "shadow_caster_mask")) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-
if (get_light_type() != RS::LIGHT_DIRECTIONAL && (p_property.name == "light_angular_distance" || p_property.name == "light_intensity_lux")) {
// Angular distance and Light Intensity Lux are only used in DirectionalLight3D.
p_property.usage = PROPERTY_USAGE_NONE;
@@ -337,10 +332,6 @@ void Light3D::_validate_property(PropertyInfo &p_property) const {
if (!GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units") && (p_property.name == "light_intensity_lumens" || p_property.name == "light_intensity_lux" || p_property.name == "light_temperature")) {
p_property.usage = PROPERTY_USAGE_NONE;
}
-
- if (!distance_fade_enabled && (p_property.name == "distance_fade_begin" || p_property.name == "distance_fade_shadow" || p_property.name == "distance_fade_length")) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
}
void Light3D::_bind_methods() {
@@ -408,7 +399,7 @@ void Light3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "light_cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask");
ADD_GROUP("Shadow", "shadow_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled"), "set_shadow", "has_shadow");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_shadow", "has_shadow");
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "shadow_bias", PROPERTY_HINT_RANGE, "0,10,0.001"), "set_param", "get_param", PARAM_SHADOW_BIAS);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "shadow_normal_bias", PROPERTY_HINT_RANGE, "0,10,0.001"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_reverse_cull_face"), "set_shadow_reverse_cull_face", "get_shadow_reverse_cull_face");
@@ -418,7 +409,7 @@ void Light3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_caster_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_shadow_caster_mask", "get_shadow_caster_mask");
ADD_GROUP("Distance Fade", "distance_fade_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distance_fade_enabled"), "set_enable_distance_fade", "is_distance_fade_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distance_fade_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_enable_distance_fade", "is_distance_fade_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_begin", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,or_greater,suffix:m"), "set_distance_fade_begin", "get_distance_fade_begin");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_shadow", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,or_greater,suffix:m"), "set_distance_fade_shadow", "get_distance_fade_shadow");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "distance_fade_length", PROPERTY_HINT_RANGE, "0.0,4096.0,0.01,or_greater,suffix:m"), "set_distance_fade_length", "get_distance_fade_length");
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 87da1567238..1fa6d73a202 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -3276,8 +3276,8 @@ void LineEdit::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_force_displayed"), "set_caret_force_displayed", "is_caret_force_displayed");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_mid_grapheme"), "set_caret_mid_grapheme_enabled", "is_caret_mid_grapheme_enabled");
- ADD_GROUP("Secret", "");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "secret"), "set_secret", "is_secret");
+ ADD_GROUP("Secret", "secret");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "secret", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_secret", "is_secret");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "secret_character"), "set_secret_character", "get_secret_character");
ADD_GROUP("BiDi", "");
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index cfa884f1796..6912d3f3e1b 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -277,7 +277,6 @@ void CanvasLayer::set_follow_viewport(bool p_enable) {
follow_viewport = p_enable;
_update_follow_viewport();
- notify_property_list_changed();
}
bool CanvasLayer::is_following_viewport() const {
@@ -304,12 +303,6 @@ void CanvasLayer::_update_follow_viewport(bool p_force_exit) {
}
}
-void CanvasLayer::_validate_property(PropertyInfo &p_property) const {
- if (!follow_viewport && p_property.name == "follow_viewport_scale") {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-}
-
void CanvasLayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_layer", "layer"), &CanvasLayer::set_layer);
ClassDB::bind_method(D_METHOD("get_layer"), &CanvasLayer::get_layer);
@@ -354,7 +347,7 @@ void CanvasLayer::_bind_methods() {
ADD_GROUP("", "");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", PROPERTY_USAGE_NONE), "set_custom_viewport", "get_custom_viewport");
ADD_GROUP("Follow Viewport", "follow_viewport");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "follow_viewport_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_follow_viewport", "is_following_viewport");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "follow_viewport_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_follow_viewport", "is_following_viewport");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "follow_viewport_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001,or_greater,or_less"), "set_follow_viewport_scale", "get_follow_viewport_scale");
ADD_SIGNAL(MethodInfo("visibility_changed"));
diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h
index 84137e23cfe..7bd7c54f257 100644
--- a/scene/main/canvas_layer.h
+++ b/scene/main/canvas_layer.h
@@ -63,7 +63,6 @@ class CanvasLayer : public Node {
protected:
void _notification(int p_what);
static void _bind_methods();
- void _validate_property(PropertyInfo &p_property) const;
public:
void update_draw_order();
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index a6d538f598e..759c239159e 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -240,7 +240,6 @@ void Environment::_update_tonemap() {
void Environment::set_ssr_enabled(bool p_enabled) {
ssr_enabled = p_enabled;
_update_ssr();
- notify_property_list_changed();
}
bool Environment::is_ssr_enabled() const {
@@ -298,7 +297,6 @@ void Environment::_update_ssr() {
void Environment::set_ssao_enabled(bool p_enabled) {
ssao_enabled = p_enabled;
_update_ssao();
- notify_property_list_changed();
}
bool Environment::is_ssao_enabled() const {
@@ -396,7 +394,6 @@ void Environment::_update_ssao() {
void Environment::set_ssil_enabled(bool p_enabled) {
ssil_enabled = p_enabled;
_update_ssil();
- notify_property_list_changed();
}
bool Environment::is_ssil_enabled() const {
@@ -454,7 +451,6 @@ void Environment::_update_ssil() {
void Environment::set_sdfgi_enabled(bool p_enabled) {
sdfgi_enabled = p_enabled;
_update_sdfgi();
- notify_property_list_changed();
}
bool Environment::is_sdfgi_enabled() const {
@@ -589,7 +585,6 @@ void Environment::_update_sdfgi() {
void Environment::set_glow_enabled(bool p_enabled) {
glow_enabled = p_enabled;
_update_glow();
- notify_property_list_changed();
}
bool Environment::is_glow_enabled() const {
@@ -756,7 +751,6 @@ void Environment::_update_glow() {
void Environment::set_fog_enabled(bool p_enabled) {
fog_enabled = p_enabled;
_update_fog();
- notify_property_list_changed();
}
bool Environment::is_fog_enabled() const {
@@ -919,7 +913,6 @@ void Environment::_update_volumetric_fog() {
void Environment::set_volumetric_fog_enabled(bool p_enable) {
volumetric_fog_enabled = p_enable;
_update_volumetric_fog();
- notify_property_list_changed();
}
bool Environment::is_volumetric_fog_enabled() const {
@@ -1021,7 +1014,6 @@ float Environment::get_volumetric_fog_temporal_reprojection_amount() const {
void Environment::set_adjustment_enabled(bool p_enabled) {
adjustment_enabled = p_enabled;
_update_adjustment();
- notify_property_list_changed();
}
bool Environment::is_adjustment_enabled() const {
@@ -1161,32 +1153,6 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
if (p_property.name == "background_intensity" && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
-
- static const char *hide_prefixes[] = {
- "fog_",
- "volumetric_fog_",
- "ssr_",
- "ssao_",
- "ssil_",
- "sdfgi_",
- "glow_",
- "adjustment_",
- nullptr
-
- };
-
- const char **prefixes = hide_prefixes;
- while (*prefixes) {
- String prefix = String(*prefixes);
-
- String enabled = prefix + "enabled";
- if (p_property.name.begins_with(prefix) && p_property.name != enabled && !bool(get(enabled))) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- return;
- }
-
- prefixes++;
- }
}
#ifndef DISABLE_DEPRECATED
@@ -1294,7 +1260,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_ssr_depth_tolerance"), &Environment::get_ssr_depth_tolerance);
ADD_GROUP("SSR", "ssr_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssr_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_ssr_enabled", "is_ssr_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssr_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_ssr_enabled", "is_ssr_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "ssr_max_steps", PROPERTY_HINT_RANGE, "1,512,1"), "set_ssr_max_steps", "get_ssr_max_steps");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssr_fade_in", PROPERTY_HINT_EXP_EASING, "positive_only"), "set_ssr_fade_in", "get_ssr_fade_in");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssr_fade_out", PROPERTY_HINT_EXP_EASING, "positive_only"), "set_ssr_fade_out", "get_ssr_fade_out");
@@ -1321,7 +1287,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_ssao_ao_channel_affect"), &Environment::get_ssao_ao_channel_affect);
ADD_GROUP("SSAO", "ssao_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssao_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_ssao_enabled", "is_ssao_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssao_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_ssao_enabled", "is_ssao_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_radius", PROPERTY_HINT_RANGE, "0.01,16,0.01,or_greater"), "set_ssao_radius", "get_ssao_radius");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_intensity", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_ssao_intensity", "get_ssao_intensity");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssao_power", PROPERTY_HINT_EXP_EASING, "positive_only"), "set_ssao_power", "get_ssao_power");
@@ -1344,7 +1310,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_ssil_normal_rejection"), &Environment::get_ssil_normal_rejection);
ADD_GROUP("SSIL", "ssil_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssil_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_ssil_enabled", "is_ssil_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ssil_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_ssil_enabled", "is_ssil_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssil_radius", PROPERTY_HINT_RANGE, "0.01,16,0.01,or_greater,suffix:m"), "set_ssil_radius", "get_ssil_radius");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssil_intensity", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_ssil_intensity", "get_ssil_intensity");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ssil_sharpness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ssil_sharpness", "get_ssil_sharpness");
@@ -1378,7 +1344,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_sdfgi_probe_bias"), &Environment::get_sdfgi_probe_bias);
ADD_GROUP("SDFGI", "sdfgi_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sdfgi_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_sdfgi_enabled", "is_sdfgi_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sdfgi_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_sdfgi_enabled", "is_sdfgi_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sdfgi_use_occlusion"), "set_sdfgi_use_occlusion", "is_sdfgi_using_occlusion");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sdfgi_read_sky_light"), "set_sdfgi_read_sky_light", "is_sdfgi_reading_sky_light");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sdfgi_bounce_feedback", PROPERTY_HINT_RANGE, "0,1.99,0.01"), "set_sdfgi_bounce_feedback", "get_sdfgi_bounce_feedback");
@@ -1423,7 +1389,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_glow_map"), &Environment::get_glow_map);
ADD_GROUP("Glow", "glow_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "glow_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_glow_enabled", "is_glow_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "glow_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_glow_enabled", "is_glow_enabled");
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "glow_levels/1", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_glow_level", "get_glow_level", 0);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "glow_levels/2", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_glow_level", "get_glow_level", 1);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "glow_levels/3", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_glow_level", "get_glow_level", 2);
@@ -1479,7 +1445,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_fog_depth_end"), &Environment::get_fog_depth_end);
ADD_GROUP("Fog", "fog_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_fog_enabled", "is_fog_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fog_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_fog_enabled", "is_fog_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "fog_mode", PROPERTY_HINT_ENUM, "Exponential,Depth"), "set_fog_mode", "get_fog_mode");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "fog_light_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_fog_light_color", "get_fog_light_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fog_light_energy", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_fog_light_energy", "get_fog_light_energy");
@@ -1523,7 +1489,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_volumetric_fog_temporal_reprojection_amount"), &Environment::get_volumetric_fog_temporal_reprojection_amount);
ADD_GROUP("Volumetric Fog", "volumetric_fog_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "volumetric_fog_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_volumetric_fog_enabled", "is_volumetric_fog_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "volumetric_fog_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_volumetric_fog_enabled", "is_volumetric_fog_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "volumetric_fog_density", PROPERTY_HINT_RANGE, "0,1,0.0001,or_greater"), "set_volumetric_fog_density", "get_volumetric_fog_density");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "volumetric_fog_albedo", PROPERTY_HINT_COLOR_NO_ALPHA), "set_volumetric_fog_albedo", "get_volumetric_fog_albedo");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "volumetric_fog_emission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_volumetric_fog_emission", "get_volumetric_fog_emission");
@@ -1552,7 +1518,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_adjustment_color_correction"), &Environment::get_adjustment_color_correction);
ADD_GROUP("Adjustments", "adjustment_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "adjustment_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_adjustment_enabled", "is_adjustment_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "adjustment_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_adjustment_enabled", "is_adjustment_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_brightness", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_brightness", "get_adjustment_brightness");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_contrast", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_contrast", "get_adjustment_contrast");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "adjustment_saturation", PROPERTY_HINT_RANGE, "0.01,8,0.01"), "set_adjustment_saturation", "get_adjustment_saturation");
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index de5bee6b623..868774d4ebb 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -2398,7 +2398,6 @@ void BaseMaterial3D::set_feature(Feature p_feature, bool p_enabled) {
}
features[p_feature] = p_enabled;
- notify_property_list_changed();
_queue_shader_change();
}
@@ -2446,26 +2445,7 @@ BaseMaterial3D::TextureFilter BaseMaterial3D::get_texture_filter() const {
return texture_filter;
}
-void BaseMaterial3D::_validate_feature(const String &text, Feature feature, PropertyInfo &property) const {
- if (!features[feature] && property.name.begins_with(text) && !property.name.ends_with("_enabled")) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
- }
-}
-
void BaseMaterial3D::_validate_property(PropertyInfo &p_property) const {
- _validate_feature("normal", FEATURE_NORMAL_MAPPING, p_property);
- _validate_feature("bent_normal", FEATURE_BENT_NORMAL_MAPPING, p_property);
- _validate_feature("emission", FEATURE_EMISSION, p_property);
- _validate_feature("rim", FEATURE_RIM, p_property);
- _validate_feature("clearcoat", FEATURE_CLEARCOAT, p_property);
- _validate_feature("anisotropy", FEATURE_ANISOTROPY, p_property);
- _validate_feature("ao", FEATURE_AMBIENT_OCCLUSION, p_property);
- _validate_feature("heightmap", FEATURE_HEIGHT_MAPPING, p_property);
- _validate_feature("subsurf_scatter", FEATURE_SUBSURFACE_SCATTERING, p_property);
- _validate_feature("backlight", FEATURE_BACKLIGHT, p_property);
- _validate_feature("refraction", FEATURE_REFRACTION, p_property);
- _validate_feature("detail", FEATURE_DETAIL, p_property);
-
if (p_property.name == "emission_intensity" && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) {
p_property.usage = PROPERTY_USAGE_NONE;
}
@@ -3256,7 +3236,7 @@ void BaseMaterial3D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "roughness_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_roughness_texture_channel", "get_roughness_texture_channel");
ADD_GROUP("Emission", "emission_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_EMISSION);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_EMISSION);
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "emission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_emission", "get_emission");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_energy_multiplier", PROPERTY_HINT_RANGE, "0,16,0.01,or_greater"), "set_emission_energy_multiplier", "get_emission_energy_multiplier");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_intensity", PROPERTY_HINT_RANGE, "0,100000.0,0.01,or_greater,suffix:nt"), "set_emission_intensity", "get_emission_intensity");
@@ -3266,40 +3246,40 @@ void BaseMaterial3D::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "emission_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_EMISSION);
ADD_GROUP("Normal Map", "normal_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "normal_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_NORMAL_MAPPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "normal_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_NORMAL_MAPPING);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "normal_scale", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_normal_scale", "get_normal_scale");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "normal_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_NORMAL);
ADD_GROUP("Bent Normal Map", "bent_normal_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "bent_normal_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_BENT_NORMAL_MAPPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "bent_normal_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_BENT_NORMAL_MAPPING);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "bent_normal_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_BENT_NORMAL);
ADD_GROUP("Rim", "rim_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "rim_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_RIM);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "rim_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_RIM);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rim", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim", "get_rim");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rim_tint", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_rim_tint", "get_rim_tint");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "rim_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_RIM);
ADD_GROUP("Clearcoat", "clearcoat_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "clearcoat_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_CLEARCOAT);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "clearcoat_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_CLEARCOAT);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "clearcoat", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat", "get_clearcoat");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "clearcoat_roughness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_clearcoat_roughness", "get_clearcoat_roughness");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "clearcoat_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_CLEARCOAT);
ADD_GROUP("Anisotropy", "anisotropy_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anisotropy_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_ANISOTROPY);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anisotropy_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_ANISOTROPY);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "anisotropy", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_anisotropy", "get_anisotropy");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anisotropy_flowmap", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_FLOWMAP);
ADD_GROUP("Ambient Occlusion", "ao_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_AMBIENT_OCCLUSION);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_AMBIENT_OCCLUSION);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao_light_affect", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_light_affect", "get_ao_light_affect");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "ao_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_AMBIENT_OCCLUSION);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "ao_on_uv2"), "set_flag", "get_flag", FLAG_AO_ON_UV2);
ADD_PROPERTY(PropertyInfo(Variant::INT, "ao_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_ao_texture_channel", "get_ao_texture_channel");
ADD_GROUP("Height", "heightmap_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "heightmap_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_HEIGHT_MAPPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "heightmap_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_HEIGHT_MAPPING);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "heightmap_scale", PROPERTY_HINT_RANGE, "-16,16,0.001"), "set_heightmap_scale", "get_heightmap_scale");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "heightmap_deep_parallax"), "set_heightmap_deep_parallax", "is_heightmap_deep_parallax_enabled");
ADD_PROPERTY(PropertyInfo(Variant::INT, "heightmap_min_layers", PROPERTY_HINT_RANGE, "1,64,1"), "set_heightmap_deep_parallax_min_layers", "get_heightmap_deep_parallax_min_layers");
@@ -3310,31 +3290,31 @@ void BaseMaterial3D::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "heightmap_flip_texture"), "set_flag", "get_flag", FLAG_INVERT_HEIGHTMAP);
ADD_GROUP("Subsurf Scatter", "subsurf_scatter_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_SUBSURFACE_SCATTERING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_SUBSURFACE_SCATTERING);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "subsurf_scatter_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_subsurface_scattering_strength", "get_subsurface_scattering_strength");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_skin_mode"), "set_flag", "get_flag", FLAG_SUBSURFACE_MODE_SKIN);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "subsurf_scatter_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_SUBSURFACE_SCATTERING);
ADD_SUBGROUP("Transmittance", "subsurf_scatter_transmittance_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_transmittance_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_SUBSURFACE_TRANSMITTANCE);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "subsurf_scatter_transmittance_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_SUBSURFACE_TRANSMITTANCE);
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "subsurf_scatter_transmittance_color"), "set_transmittance_color", "get_transmittance_color");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "subsurf_scatter_transmittance_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_SUBSURFACE_TRANSMITTANCE);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "subsurf_scatter_transmittance_depth", PROPERTY_HINT_RANGE, "0.001,8,0.001,or_greater"), "set_transmittance_depth", "get_transmittance_depth");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "subsurf_scatter_transmittance_boost", PROPERTY_HINT_RANGE, "0.00,1.0,0.01"), "set_transmittance_boost", "get_transmittance_boost");
ADD_GROUP("Back Lighting", "backlight_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "backlight_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_BACKLIGHT);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "backlight_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_BACKLIGHT);
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "backlight", PROPERTY_HINT_COLOR_NO_ALPHA), "set_backlight", "get_backlight");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "backlight_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_BACKLIGHT);
ADD_GROUP("Refraction", "refraction_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "refraction_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_REFRACTION);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "refraction_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_REFRACTION);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "refraction_scale", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_refraction", "get_refraction");
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "refraction_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_REFRACTION);
ADD_PROPERTY(PropertyInfo(Variant::INT, "refraction_texture_channel", PROPERTY_HINT_ENUM, "Red,Green,Blue,Alpha,Gray"), "set_refraction_texture_channel", "get_refraction_texture_channel");
ADD_GROUP("Detail", "detail_");
- ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "detail_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_feature", "get_feature", FEATURE_DETAIL);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "detail_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_feature", "get_feature", FEATURE_DETAIL);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "detail_mask", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_texture", "get_texture", TEXTURE_DETAIL_MASK);
ADD_PROPERTY(PropertyInfo(Variant::INT, "detail_blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Subtract,Multiply"), "set_detail_blend_mode", "get_detail_blend_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "detail_uv_layer", PROPERTY_HINT_ENUM, "UV1,UV2"), "set_detail_uv", "get_detail_uv");
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 17f14d51bea..c97224ea23c 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -567,8 +567,6 @@ private:
Ref textures[TEXTURE_MAX];
- _FORCE_INLINE_ void _validate_feature(const String &text, Feature feature, PropertyInfo &property) const;
-
static HashMap> materials_for_2d; //used by Sprite3D, Label3D and other stuff
protected:
diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp
index d248ad4a678..cb5a0e08005 100644
--- a/scene/resources/particle_process_material.cpp
+++ b/scene/resources/particle_process_material.cpp
@@ -1882,18 +1882,6 @@ void ParticleProcessMaterial::_validate_property(PropertyInfo &p_property) const
p_property.usage = PROPERTY_USAGE_NONE;
}
- if (!turbulence_enabled) {
- if (p_property.name == "turbulence_noise_strength" ||
- p_property.name == "turbulence_noise_scale" ||
- p_property.name == "turbulence_noise_speed" ||
- p_property.name == "turbulence_noise_speed_random" ||
- p_property.name == "turbulence_influence_over_life" ||
- p_property.name == "turbulence_influence" ||
- p_property.name == "turbulence_initial_displacement") {
- p_property.usage &= ~PROPERTY_USAGE_EDITOR;
- }
- }
-
if (p_property.name == "collision_friction" && collision_mode != COLLISION_RIGID) {
p_property.usage = PROPERTY_USAGE_NONE;
}
@@ -2263,7 +2251,7 @@ void ParticleProcessMaterial::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_OFFSET);
ADD_GROUP("Turbulence", "turbulence_");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "turbulence_enabled", PROPERTY_HINT_GROUP_ENABLE), "set_turbulence_enabled", "get_turbulence_enabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "turbulence_enabled", PROPERTY_HINT_GROUP_ENABLE, "feature"), "set_turbulence_enabled", "get_turbulence_enabled");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "turbulence_noise_strength", PROPERTY_HINT_RANGE, "0,20,0.01"), "set_turbulence_noise_strength", "get_turbulence_noise_strength");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "turbulence_noise_scale", PROPERTY_HINT_RANGE, "0,10,0.001,or_greater"), "set_turbulence_noise_scale", "get_turbulence_noise_scale");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "turbulence_noise_speed"), "set_turbulence_noise_speed", "get_turbulence_noise_speed");