Resolve scopes before flattening network (#4235)

* Compiler changes

* Run preprocessor on wrapping network

* Remove test nodes

* FIx

* move generate_node_paths call to compiler

* Make it more obvious what input is set to
This commit is contained in:
Timon
2026-06-15 14:39:55 +00:00
committed by Keavon Chambers
parent 34e0fd7757
commit 077d11bdba
8 changed files with 132 additions and 110 deletions

View File

@@ -345,13 +345,13 @@ impl NodeRuntime {
None
}
async fn update_network(&mut self, mut graph: NodeNetwork) -> Result<ResolvedDocumentNodeTypesDelta, (ResolvedDocumentNodeTypesDelta, String)> {
if let Err(e) = self.preprocessor.expand_network(&mut graph, &self.resources) {
async fn update_network(&mut self, graph: NodeNetwork) -> Result<ResolvedDocumentNodeTypesDelta, (ResolvedDocumentNodeTypesDelta, String)> {
let mut scoped_network = wrap_network_in_scope(graph, self.editor_api.clone());
if let Err(e) = self.preprocessor.preprocess(&mut scoped_network, &self.resources) {
return Err((ResolvedDocumentNodeTypesDelta::default(), e.to_string()));
}
let scoped_network = wrap_network_in_scope(graph, self.editor_api.clone());
// We assume only one output
assert_eq!(scoped_network.exports.len(), 1, "Graph with multiple outputs not yet handled");