From e56cf87f3cee270f2f1f3a33a153868bd85193a7 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Thu, 28 Aug 2025 18:08:00 +0100 Subject: [PATCH] Fix `is_visible_in_tree` regression for out of tree --- scene/3d/spatial.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 79f37ed89e0..163691d65d6 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -913,14 +913,15 @@ void Spatial::show() { data.visible = true; - if (!is_inside_tree()) { - return; - } - bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true; if (parent_visible) { _propagate_visible_in_tree(true); } + + if (!is_inside_tree()) { + return; + } + _propagate_visibility_changed(); } @@ -931,14 +932,15 @@ void Spatial::hide() { data.visible = false; - if (!is_inside_tree()) { - return; - } - bool parent_visible = get_parent_spatial() ? get_parent_spatial()->data.visible_in_tree : true; if (parent_visible) { _propagate_visible_in_tree(false); } + + if (!is_inside_tree()) { + return; + } + _propagate_visibility_changed(); }