From 3e5f3e9d3504c955cf635168653f40e0315b6c7a Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Thu, 25 Dec 2025 14:30:28 +0100 Subject: [PATCH] Fix sorting_offset property flags for Decal --- doc/classes/VisualInstance3D.xml | 2 +- scene/3d/decal.cpp | 6 ++++++ scene/3d/decal.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/classes/VisualInstance3D.xml b/doc/classes/VisualInstance3D.xml index f36afa1d3bb..e67934f5c92 100644 --- a/doc/classes/VisualInstance3D.xml +++ b/doc/classes/VisualInstance3D.xml @@ -63,7 +63,7 @@ To adjust [member layers] more easily using a script, use [method get_layer_mask_value] and [method set_layer_mask_value]. [b]Note:[/b] [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [member GeometryInstance3D.gi_mode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and [member Light3D.light_bake_mode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. - + The amount by which the depth of this [VisualInstance3D] will be adjusted when sorting by depth. Uses the same units as the engine (which are typically meters). Adjusting it to a higher value will make the [VisualInstance3D] reliably draw on top of other [VisualInstance3D]s that are otherwise positioned at the same spot. To ensure it always draws on top of other objects around it (not positioned at the same spot), set the value to be greater than the distance between this [VisualInstance3D] and the other nearby [VisualInstance3D]s. diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp index 169db4a9575..2e48a5ca32d 100644 --- a/scene/3d/decal.cpp +++ b/scene/3d/decal.cpp @@ -166,6 +166,12 @@ AABB Decal::get_aabb() const { return aabb; } +void Decal::_validate_property(PropertyInfo &p_property) const { + if (p_property.name == "sorting_offset") { + p_property.usage = PROPERTY_USAGE_DEFAULT; + } +} + PackedStringArray Decal::get_configuration_warnings() const { PackedStringArray warnings = VisualInstance3D::get_configuration_warnings(); diff --git a/scene/3d/decal.h b/scene/3d/decal.h index f38265dd800..e9e16fd15c6 100644 --- a/scene/3d/decal.h +++ b/scene/3d/decal.h @@ -61,6 +61,7 @@ private: protected: static void _bind_methods(); + void _validate_property(PropertyInfo &p_property) const; #ifndef DISABLE_DEPRECATED bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_property) const;