Repository: godotengine/godot (language: cpp)

Issue:
[Debug] NavigationLink3D debug rendering does not listen to parent's visibility propagation
### Tested versions

Tested using a build of this PR https://github.com/godotengine/godot/pull/102769, but I reckon the issue affects older, released Godot versions as well

### System information

Ubuntu - Godot 4.4 dev

### Issue description

When a NavigationLink3D is in a scene and its parent is not visible, but you set the parent visible at runtime, the link's debug rendering is not triggered, even if the necessary flags in the editor are set

### Steps to reproduce

reproduction steps
1. run the project
2. add a NavigationLink3D as a child to a node that's not visible
3. make the link's parent node visible

expected
* the debug rending of the NavigationLink3D

actual
* nothing rendered

side notes:
* in editor's remote scene section, you can click the nodes and still get an orange bounding box around the selected node's position in the game window


### Minimal reproduction project (MRP)

-


Discussion / hints:
The debug instance checks if the node is visible in the tree when the debug is created but does not go further than that.

`RS::get_singleton()->instance_set_visible(debug_instance, is_visible_in_tree());`

So what likely needs to happen is that the debug also reacts to a NOTIFICATION_VISIBILITY_CHANGED notification in case the node visibility gets toggled or a parent node propagates.
Pretty easy to reproduce in 4.4-stable, I will go ahead and write a fix!

Fix patch:
diff --git a/scene/3d/navigation_link_3d.cpp b/scene/3d/navigation_link_3d.cpp
index 8f9b7a60b513..dc518ee45256 100644
--- a/scene/3d/navigation_link_3d.cpp
+++ b/scene/3d/navigation_link_3d.cpp
@@ -262,6 +262,12 @@ void NavigationLink3D::_notification(int p_what) {
 		case NOTIFICATION_EXIT_TREE: {
 			_link_exit_navigation_map();
 		} break;
+
+#ifdef DEBUG_ENABLED
+		case NOTIFICATION_VISIBILITY_CHANGED: {
+			_update_debug_mesh();
+		} break;
+#endif // DEBUG_ENABLED
 	}
 }
 


Test patch: