Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions editor/shader/visual_shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,10 @@ void VisualShaderEditor::_update_graph() {
return;
}

if (!is_inside_tree()) {
return;
}

VisualShader::Type type = get_current_shader_type();

graph->clear_connections();
Expand Down Expand Up @@ -5343,12 +5347,18 @@ void VisualShaderEditor::_notification(int p_what) {

if (is_visible_in_tree()) {
_update_graph();
} else {
theme_dirty = true;
}
update_toggle_files_button();
} break;

case NOTIFICATION_VISIBILITY_CHANGED: {
update_toggle_files_button();
if (theme_dirty && is_visible_in_tree()) {
theme_dirty = false;
_update_graph();
}
} break;

case NOTIFICATION_DRAG_BEGIN: {
Expand Down
1 change: 1 addition & 0 deletions editor/shader/visual_shader_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class VisualShaderEditor : public ShaderEditor {
CheckBox *custom_mode_box = nullptr;
bool custom_mode_enabled = false;

bool theme_dirty = false;
bool pending_update_preview = false;
bool shader_error = false;
AcceptDialog *code_preview_window = nullptr;
Expand Down