summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorMrBlockers <1747505+MrBlockers@users.noreply.github.com>2022-10-23 11:35:29 -0400
committerMrBlockers <1747505+MrBlockers@users.noreply.github.com>2022-10-25 18:23:23 -0400
commit92ebbf2c0acc232ba0818a5dcb1d3dfc4dd5df67 (patch)
treea281b25a89999dbf01a0385f99c9eecf8cb2e591 /scene/3d
parent5b84583b95b68531a578a4da02974978b759915e (diff)
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.
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/sprite_3d.cpp5
1 files changed, 5 insertions, 0 deletions
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() {