diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-10-25 22:04:30 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-10-25 22:04:30 +0200 |
commit | f2c2ecb6e8e8408bb2453e4b8a0d56f49cac2edd (patch) | |
tree | d60838624201342de920f643b58d734678bcecf6 /scene/3d | |
parent | 7d37fb7aff7e34cda7e97ca5abf7e2b8afef794d (diff) |
Fix properties being displayed when they shouldn't in DirectionalLight3D
The parent `_validate_property()` wasn't called, which led to shadow
properties being visible even if shadows were disabled on a
DirectionalLight3D node.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/light_3d.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 27e53ce640..fbdbd79c0c 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -361,7 +361,6 @@ DirectionalLight3D::ShadowMode DirectionalLight3D::get_shadow_mode() const { void DirectionalLight3D::set_blend_splits(bool p_enable) { blend_splits = p_enable; RS::get_singleton()->light_directional_set_blend_splits(light, p_enable); - notify_property_list_changed(); } bool DirectionalLight3D::is_blend_splits_enabled() const { @@ -379,12 +378,12 @@ bool DirectionalLight3D::is_sky_only() const { void DirectionalLight3D::_validate_property(PropertyInfo &property) const { if (shadow_mode == SHADOW_ORTHOGONAL && (property.name == "directional_shadow_split_1" || property.name == "directional_shadow_blend_splits")) { - // Split 2 and split blending are only used with PSSM 2 Splits and PSSM 4 Splits shadow mode. + // Split 2 and split blending are only used with the PSSM 2 Splits and PSSM 4 Splits shadow modes. property.usage = PROPERTY_USAGE_NOEDITOR; } if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS) && (property.name == "directional_shadow_split_2" || property.name == "directional_shadow_split_3")) { - // Splits 3 and 4 are only used with PSSM 4 Splits shadow mode. + // Splits 3 and 4 are only used with the PSSM 4 Splits shadow mode. property.usage = PROPERTY_USAGE_NOEDITOR; } @@ -392,6 +391,8 @@ void DirectionalLight3D::_validate_property(PropertyInfo &property) const { // Not implemented in DirectionalLight3D (`light_size` is replaced by `light_angular_distance`). property.usage = PROPERTY_USAGE_NONE; } + + Light3D::_validate_property(property); } void DirectionalLight3D::_bind_methods() { |