summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-12-26 21:59:19 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-12-26 21:59:51 +0100
commit58fcf5ed70ff8844d3a1a019c278cb25297499b4 (patch)
tree944e234ab9b24c542a1484ddafab468513fe0f48
parentb6e06038f8a373f7fb8d26e92d5f06887e459598 (diff)
Hide Ambient Light properties in Environment inspector depending on mode
-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 23bd8a4be4..92c99c7175 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;