summaryrefslogtreecommitdiffstats
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index ec0edc0c96..2f31613903 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -5080,8 +5080,11 @@ void VisualShaderEditor::_param_property_changed(const String &p_property, const
void VisualShaderEditor::_update_current_param() {
if (current_prop != nullptr) {
String name = current_prop->get_meta("id");
- preview_material->set("shader_parameter/" + name, visual_shader->_get_preview_shader_parameter(name));
-
+ if (visual_shader->_has_preview_shader_parameter(name)) {
+ preview_material->set("shader_parameter/" + name, visual_shader->_get_preview_shader_parameter(name));
+ } else {
+ preview_material->set("shader_parameter/" + name, Variant());
+ }
current_prop->update_property();
current_prop->update_editor_property_status();
current_prop->update_cache();