summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/material.cpp16
-rw-r--r--scene/resources/material.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 2c278f4fed..e3427cbe2c 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -458,6 +458,8 @@ FixedMaterial::~FixedMaterial() {
}
+
+
bool ShaderMaterial::_set(const StringName& p_name, const Variant& p_value) {
if (p_name==SceneStringNames::get_singleton()->shader_shader) {
@@ -558,7 +560,21 @@ void ShaderMaterial::_bind_methods() {
}
+void ShaderMaterial::get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const {
+
+ String f = p_function.operator String();
+ if ((f=="get_shader_param" || f=="set_shader_param") && p_idx==0) {
+ if (shader.is_valid()) {
+ List<PropertyInfo> pl;
+ shader->get_param_list(&pl);
+ for (List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) {
+ r_options->push_back(E->get().name);
+ }
+ }
+ }
+ Material::get_argument_options(p_function,p_idx,r_options);
+}
ShaderMaterial::ShaderMaterial() :Material(VisualServer::get_singleton()->material_create()){
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 9c3feede08..2b10078e16 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -243,6 +243,7 @@ public:
void set_shader_param(const StringName& p_param,const Variant& p_value);
Variant get_shader_param(const StringName& p_param) const;
+ void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const;
ShaderMaterial();
};