From f2c2ecb6e8e8408bb2453e4b8a0d56f49cac2edd Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 25 Oct 2021 22:04:30 +0200 Subject: 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. --- scene/3d/light_3d.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scene/3d') 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() { -- cgit v1.2.3