Hide extra options from various nodes if they're not enabled

This commit is contained in:
Michael Alexsander 2020-02-13 23:34:59 -03:00
parent 8fbe644b6e
commit 70304f8633
14 changed files with 87 additions and 7 deletions

View file

@ -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