summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-19 21:53:02 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-19 21:53:02 +0100
commitfc5fafbb328ff433d0bf32d510ae2ceb380fe230 (patch)
tree5c769f40f6ac155e14e14410c26428d19686192c /scene/resources
parentd919d773676b507f8b7cd318a2a080b9d3906c8d (diff)
parent58fcf5ed70ff8844d3a1a019c278cb25297499b4 (diff)
Merge pull request #70602 from Calinou/environment-no-sky-hide-ambient-light-properties
Hide Ambient Light properties in Environment inspector depending on mode
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/environment.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 746f2f8f9b..8b4656414d 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;