From 08b90465989bbad5a81f33f1551e88eae916510c Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 31 Dec 2023 16:20:38 +0100 Subject: [PATCH] Automatically add path to built-in shaders --- editor/shader_create_dialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index fb91d139a75..7d6da5cf3e6 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -243,7 +243,12 @@ void fog() { emit_signal(SNAME("shader_include_created"), shader_inc); } else { - if (!is_built_in) { + if (is_built_in) { + Node *edited_scene = get_tree()->get_edited_scene_root(); + if (likely(edited_scene)) { + shader->set_path(edited_scene->get_scene_file_path() + "::"); + } + } else { String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text()); shader->set_path(lpath);