You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Don't try to update the visual shader graph if it doesn't exist yet
When setting shader mode on a visual shader that was just created in the editor we try to _update_graph(). However, the graph does not yet exist in the visualshadereditor. This gets populated in VisualShaderEditor::edit() which hasn't been called yet. This PR simply changes the logic to not try to update the non-existent graph. This fixes #20322
This commit is contained in:
@@ -119,6 +119,9 @@ void VisualShaderEditor::_update_graph() {
|
|||||||
if (updating)
|
if (updating)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (visual_shader.is_null())
|
||||||
|
return;
|
||||||
|
|
||||||
graph->set_scroll_ofs(visual_shader->get_graph_offset() * EDSCALE);
|
graph->set_scroll_ofs(visual_shader->get_graph_offset() * EDSCALE);
|
||||||
|
|
||||||
VisualShader::Type type = VisualShader::Type(edit_type->get_selected());
|
VisualShader::Type type = VisualShader::Type(edit_type->get_selected());
|
||||||
|
|||||||
Reference in New Issue
Block a user