From 92ebbf2c0acc232ba0818a5dcb1d3dfc4dd5df67 Mon Sep 17 00:00:00 2001 From: MrBlockers <1747505+MrBlockers@users.noreply.github.com> Date: Sun, 23 Oct 2022 11:35:29 -0400 Subject: Fix multiple issues with region editor Make the filter mode of the texture preview match the node/resource being edited where applicable, and nearest neighbor with mipmaps as a fallback. Make the Edit Region button for Sprite3D only appear when region is enabled, to match behavior of Sprite2D. Fix the editor not correctly clearing reference to previously edited resources, resulting in a visual bug displaying the incorrect texture. --- scene/3d/sprite_3d.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/3d') diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index be6eab2178..d69953fee5 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -680,6 +680,7 @@ void Sprite3D::set_region_enabled(bool p_region) { region = p_region; _queue_redraw(); + notify_property_list_changed(); } bool Sprite3D::is_region_enabled() const { @@ -781,6 +782,10 @@ void Sprite3D::_validate_property(PropertyInfo &p_property) const { if (p_property.name == "frame_coords") { p_property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS; } + + if (!region && (p_property.name == "region_rect")) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } } void Sprite3D::_bind_methods() { -- cgit v1.2.3