diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/decal.cpp | 9 | ||||
-rw-r--r-- | scene/3d/decal.h | 4 | ||||
-rw-r--r-- | scene/3d/light_3d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/sprite_3d.cpp | 7 |
4 files changed, 26 insertions, 0 deletions
diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp index 0f10f2b85f..b5eab35605 100644 --- a/scene/3d/decal.cpp +++ b/scene/3d/decal.cpp @@ -109,6 +109,7 @@ Color Decal::get_modulate() const { void Decal::set_enable_distance_fade(bool p_enable) { distance_fade_enabled = p_enable; RS::get_singleton()->decal_set_distance_fade(decal, distance_fade_enabled, distance_fade_begin, distance_fade_length); + notify_property_list_changed(); } bool Decal::is_distance_fade_enabled() const { @@ -153,6 +154,14 @@ Vector<Face3> Decal::get_faces(uint32_t p_usage_flags) const { return Vector<Face3>(); } +#ifdef TOOLS_ENABLED +void Decal::_validate_property(PropertyInfo &property) const { + if (!distance_fade_enabled && (property.name == "distance_fade_begin" || property.name == "distance_fade_length")) { + property.usage = PROPERTY_USAGE_NOEDITOR; + } +} +#endif + void Decal::_bind_methods() { ClassDB::bind_method(D_METHOD("set_extents", "extents"), &Decal::set_extents); ClassDB::bind_method(D_METHOD("get_extents"), &Decal::get_extents); diff --git a/scene/3d/decal.h b/scene/3d/decal.h index 095579d775..20d86ee16c 100644 --- a/scene/3d/decal.h +++ b/scene/3d/decal.h @@ -62,6 +62,10 @@ private: float distance_fade_begin = 10.0; float distance_fade_length = 1.0; +#ifdef TOOLS_ENABLED + void _validate_property(PropertyInfo &property) const override; +#endif + protected: static void _bind_methods(); diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index b0a10b5547..87f54022b3 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -65,6 +65,8 @@ void Light3D::set_shadow(bool p_enable) { if (type == RenderingServer::LIGHT_SPOT || type == RenderingServer::LIGHT_OMNI) { update_configuration_warning(); } + + notify_property_list_changed(); } bool Light3D::has_shadow() const { @@ -202,6 +204,10 @@ bool Light3D::is_editor_only() const { } void Light3D::_validate_property(PropertyInfo &property) const { + if (!shadow && (property.name == "shadow_color" || property.name == "shadow_color" || property.name == "shadow_bias" || property.name == "shadow_normal_bias" || property.name == "shadow_reverse_cull_face" || property.name == "shadow_transmittance_bias" || property.name == "shadow_blur")) { + property.usage = PROPERTY_USAGE_NOEDITOR; + } + if (get_light_type() == RS::LIGHT_DIRECTIONAL && property.name == "light_size") { property.usage = 0; } diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index cb2df9130f..f881181ccd 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -518,6 +518,7 @@ void Sprite3D::set_region(bool p_region) { region = p_region; _queue_update(); + notify_property_list_changed(); } bool Sprite3D::is_region() const { @@ -623,6 +624,12 @@ void Sprite3D::_validate_property(PropertyInfo &property) const { if (property.name == "frame_coords") { property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } + +#ifdef TOOLS_ENABLED + if (!region && property.name == "region_rect") { + property.usage = PROPERTY_USAGE_NOEDITOR; + } +#endif } void Sprite3D::_bind_methods() { |