godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.56k stars 21.09k forks source link

Weird Viewport at the Top Left of Screen #79135

Closed LunaticWyrm467 closed 1 year ago

LunaticWyrm467 commented 1 year ago

Godot version

4.1 Stable

System information

Windows 11, RTX 3050 Laptop, 11th Gen i5, Vulkan

Issue description

For whatever reason, I seem to have a white rectangle at the top-right of the screen. I can't do anything or interact with it, and it seems to be connected to one of the viewports that I had in a different scene. I've tried manipulating the viewport's settings, but I couldn't get this resolved, and I can't access any of the project settings/the node panel to navigate through my project anymore. image

Steps to reproduce

I honestly don't know what I did that resulted in this. For the MRP, I've linked the changed files since the prior commit of my project (not the actual project itself, and the prior commit worked fine, so the issue must have something to do with the new changes). I'm sorry if it's a mess, but it's better than nothing.

Minimal reproduction project

New_Commit.zip

akien-mga commented 1 year ago

It's hard to debug without having the full project, but the changes you linked include @tool scripts, and tool scripts run in the editor. It's probably one of those scripts adding something to the editor scene.

Notably in world_view.gd:

func _ready() -> void:
        var vp_tex:           ViewportTexture = get_camera().get_world_texture()
        var chromakey_buffer: ColorRect       = $Camera_FX/FX_VP_Radiance/FX_Buffer_ChromaKey/FX_Radiance_ChromaKey
        chromakey_buffer.material.set_shader_parameter("world_texture", vp_tex)
LunaticWyrm467 commented 1 year ago

Ah, I see, so if you have control nodes in a scene that is run by a @tool script, then they'll render on the Editor UI itself? I haven't experienced that before, so that's why I was confused, nor did I know about it. Is there any documentation on this?

akien-mga commented 1 year ago

Yes, see https://docs.godotengine.org/en/latest/tutorials/plugins/running_code_in_the_editor.html

Notably, the scene tree you have in a @tool script is the editor's scene tree. That's very powerful, but with great power comes great responsibility ;)

LunaticWyrm467 commented 1 year ago

Alright, gotcha! I'll be closing this then.