summaryrefslogtreecommitdiffstats
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2020-02-13 23:34:59 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2021-03-02 09:25:09 -0300
commit70304f8633c8cf8faa530dadf648ecfcabf80655 (patch)
tree1e306ddea59b2b81d9db3637b7fb3efa999e5d6f /scene/resources/material.cpp
parent8fbe644b6e6548dc2c9f9d675bc17f13b74e747b (diff)
downloadredot-engine-70304f8633c8cf8faa530dadf648ecfcabf80655.tar.gz
Hide extra options from various nodes if they're not enabled
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 062d921855..9931757cc4 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -1584,7 +1584,7 @@ void BaseMaterial3D::set_flag(Flags p_flag, bool p_enabled) {
}
flags[p_flag] = p_enabled;
- if (p_flag == FLAG_USE_SHADOW_TO_OPACITY || p_flag == FLAG_USE_TEXTURE_REPEAT || p_flag == FLAG_SUBSURFACE_MODE_SKIN) {
+ if (p_flag == FLAG_USE_SHADOW_TO_OPACITY || p_flag == FLAG_USE_TEXTURE_REPEAT || p_flag == FLAG_SUBSURFACE_MODE_SKIN || p_flag == FLAG_USE_POINT_SIZE) {
notify_property_list_changed();
}
_queue_shader_change();
@@ -1650,7 +1650,7 @@ BaseMaterial3D::TextureFilter BaseMaterial3D::get_texture_filter() const {
void BaseMaterial3D::_validate_feature(const String &text, Feature feature, PropertyInfo &property) const {
if (property.name.begins_with(text) && property.name != text + "_enabled" && !features[feature]) {
- property.usage = 0;
+ property.usage = PROPERTY_USAGE_NOEDITOR;
}
}
@@ -1683,16 +1683,24 @@ void BaseMaterial3D::_validate_property(PropertyInfo &property) const {
property.usage = 0;
}
- if (property.name == "params_grow_amount" && !grow_enabled) {
- property.usage = 0;
+ if (property.name == "billboard_keep_scale" && billboard_mode == BILLBOARD_DISABLED) {
+ property.usage = PROPERTY_USAGE_NOEDITOR;
+ }
+
+ if (property.name == "grow_amount" && !grow_enabled) {
+ property.usage = PROPERTY_USAGE_NOEDITOR;
+ }
+
+ if (property.name == "point_size" && !flags[FLAG_USE_POINT_SIZE]) {
+ property.usage = PROPERTY_USAGE_NOEDITOR;
}
if (property.name == "proximity_fade_distance" && !proximity_fade_enabled) {
- property.usage = 0;
+ property.usage = PROPERTY_USAGE_NOEDITOR;
}
if ((property.name == "distance_fade_max_distance" || property.name == "distance_fade_min_distance") && distance_fade == DISTANCE_FADE_DISABLED) {
- property.usage = 0;
+ property.usage = PROPERTY_USAGE_NOEDITOR;
}
// you can only enable anti-aliasing (in mataerials) on alpha scissor and alpha hash