Skip to content

Commit 70931b1

Browse files
committed
Mark preprocessed networks as generated
1 parent 67a8739 commit 70931b1

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

node-graph/graph-craft/src/document.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ pub struct NodeNetwork {
683683
#[serde(default)]
684684
#[serde(serialize_with = "graphene_core::vector::serialize_hashmap", deserialize_with = "graphene_core::vector::deserialize_hashmap")]
685685
pub scope_injections: FxHashMap<String, (NodeId, Type)>,
686+
pub generated: bool,
686687
}
687688

688689
impl Hash for NodeNetwork {
@@ -797,7 +798,9 @@ impl NodeNetwork {
797798
pub fn generate_node_paths(&mut self, prefix: &[NodeId]) {
798799
for (node_id, node) in &mut self.nodes {
799800
let mut new_path = prefix.to_vec();
800-
new_path.push(*node_id);
801+
if !self.generated {
802+
new_path.push(*node_id);
803+
}
801804
if let DocumentNodeImplementation::Network(network) = &mut node.implementation {
802805
network.generate_node_paths(new_path.as_slice());
803806
}

node-graph/interpreted-executor/src/util.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
7474
},
7575
];
7676

77+
log::debug!("This is here so this gets noticed in code review");
7778
NodeNetwork {
7879
exports: vec![NodeInput::node(NodeId(1), 0)],
7980
nodes: nodes.into_iter().enumerate().map(|(id, node)| (NodeId(id as u64), node)).collect(),
8081
scope_injections: [("editor-api".to_string(), (NodeId(2), concrete!(&WasmEditorApi)))].into_iter().collect(),
82+
// TODO: check if it makes sense to set generated to true
83+
generated: false,
8184
}
8285
}

node-graph/preprocessor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ pub fn generate_node_substitutions() -> HashMap<String, DocumentNode> {
102102
.collect();
103103

104104
if generated_nodes == 0 {
105-
log::debug!("skipping {}", id);
106105
continue;
107106
}
108107

@@ -127,6 +126,7 @@ pub fn generate_node_substitutions() -> HashMap<String, DocumentNode> {
127126
}],
128127
nodes,
129128
scope_injections: Default::default(),
129+
generated: true,
130130
}),
131131
visible: true,
132132
skip_deduplication: false,

0 commit comments

Comments
 (0)