From e0cb03a3710e97d4f8b9201ceb1a36c7adac8eeb Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sun, 2 Nov 2025 13:59:37 -0300 Subject: [PATCH] Fix visual shader items not applying the correct theme components --- editor/shader/shader_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/shader/shader_editor_plugin.cpp b/editor/shader/shader_editor_plugin.cpp index 12d4ef4117..b32077520c 100644 --- a/editor/shader/shader_editor_plugin.cpp +++ b/editor/shader/shader_editor_plugin.cpp @@ -174,7 +174,9 @@ void ShaderEditorPlugin::edit(Object *p_object) { } else { es.shader_editor = memnew(TextShaderEditor); } - es.shader_editor->edit_shader(es.shader); + // Needs to be deferred so it's called after entering the scene tree, + // otherwise it won't be able to correctly fetch the editor theme. + callable_mp(es.shader_editor, &ShaderEditor::edit_shader).call_deferred(es.shader); } // TextShaderEditor-specific setup code.