From 58fcf5ed70ff8844d3a1a019c278cb25297499b4 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 26 Dec 2022 21:59:19 +0100 Subject: [PATCH] Hide Ambient Light properties in Environment inspector depending on mode --- scene/resources/environment.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 23bd8a4be4a..92c99c71756 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1043,6 +1043,18 @@ void Environment::_validate_property(PropertyInfo &p_property) const { } } + if (p_property.name == "ambient_light_color" || p_property.name == "ambient_light_energy") { + if (ambient_source == AMBIENT_SOURCE_DISABLED) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } + } + + if (p_property.name == "ambient_light_sky_contribution") { + if (ambient_source == AMBIENT_SOURCE_DISABLED || ambient_source == AMBIENT_SOURCE_COLOR) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } + } + if (p_property.name == "fog_aerial_perspective") { if (bg_mode != BG_SKY) { p_property.usage = PROPERTY_USAGE_NO_EDITOR;