Display graph errors in the viewport (#1577)

* Display graph errors in the viewport

* Polish up the styling

* Clear click targets while graph can't be rendered

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2024-01-15 06:18:08 +00:00
committed by GitHub
parent 484acbcde3
commit 8df59be1d5
2 changed files with 17 additions and 1 deletions

View File

@@ -558,7 +558,12 @@ impl NodeGraphExecutor {
responses.add(BroadcastEvent::DocumentIsDirty);
responses.add(OverlaysMessage::Draw);
let node_graph_output = result.map_err(|e| format!("Node graph evaluation failed: {e:?}"))?;
let Ok(node_graph_output) = result else {
// Clear the click targets while the graph is in an un-renderable state
document.metadata.update_click_targets(HashMap::new());
return Err("Node graph evaluation failed".to_string());
};
document.metadata.update_transforms(new_upstream_transforms);
document.metadata.update_click_targets(new_click_targets);