Fix error emitting when reset a visual shader preview parameter

This commit is contained in:
Chaosus 2024-11-15 12:39:07 +03:00
parent 673f396677
commit 5a856a6896

View File

@ -5080,8 +5080,11 @@ void VisualShaderEditor::_param_property_changed(const String &p_property, const
void VisualShaderEditor::_update_current_param() { void VisualShaderEditor::_update_current_param() {
if (current_prop != nullptr) { if (current_prop != nullptr) {
String name = current_prop->get_meta("id"); String name = current_prop->get_meta("id");
if (visual_shader->_has_preview_shader_parameter(name)) {
preview_material->set("shader_parameter/" + name, visual_shader->_get_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_property();
current_prop->update_editor_property_status(); current_prop->update_editor_property_status();
current_prop->update_cache(); current_prop->update_cache();