Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Expose Shader::set_include_path to GDScript

Arthur Comtea26156400c41
diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml
index 6011b81499c..734485da758 100644
--- a/doc/classes/Shader.xml
+++ b/doc/classes/Shader.xml
@@ -52,6 +52,13 @@
[b]Note:[/b] If the sampler array is used use [param index] to access the specified texture.
</description>
</method>
+ <method name="set_include_path">
+ <return type="void" />
+ <param index="0" name="path" type="String" />
+ <description>
+ Sets the include path for this shader. Used only if the shader does not have a resource path set, for example when created by code.
+ </description>
+ </method>
</methods>
<members>
<member name="code" type="String" setter="set_code" getter="get_code" default="&quot;&quot;">
diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp
index dbb6083ae97..d9f7faec784 100644
--- a/scene/resources/shader.cpp
+++ b/scene/resources/shader.cpp
@@ -280,6 +280,8 @@ void Shader::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_shader_uniform_list", "get_groups"), &Shader::_get_shader_uniform_list, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("set_include_path", "path"), &Shader::set_include_path);
+
ClassDB::bind_method(D_METHOD("inspect_native_shader_code"), &Shader::inspect_native_shader_code);
ClassDB::set_method_flags(get_class_static(), StringName("inspect_native_shader_code"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);