Skip to content

Commit

Permalink
Fix error emitting when reset a visual shader preview parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosus committed Nov 15, 2024
1 parent 673f396 commit 5a856a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions editor/plugins/visual_shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5a856a6

Please sign in to comment.