File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
node-graph/preprocessor/src Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ pub fn expand_network(network: &mut NodeNetwork, substitutions: &HashMap<ProtoNo
1919 DocumentNodeImplementation :: Network ( node_network) => expand_network ( node_network, substitutions) ,
2020 DocumentNodeImplementation :: ProtoNode ( proto_node_identifier) => {
2121 if let Some ( new_node) = substitutions. get ( proto_node_identifier) {
22+ // Reconcile the document node's inputs with what the current node definition expects,
23+ // since the saved document may have fewer or more inputs than the current version
24+ while node. inputs . len ( ) < new_node. inputs . len ( ) {
25+ node. inputs . push ( new_node. inputs [ node. inputs . len ( ) ] . clone ( ) ) ;
26+ }
27+ node. inputs . truncate ( new_node. inputs . len ( ) ) ;
28+
2229 node. implementation = new_node. implementation . clone ( ) ;
2330 }
2431 }
@@ -59,6 +66,7 @@ pub fn generate_node_substitutions() -> HashMap<ProtoNodeIdentifier, DocumentNod
5966 let mut generated_nodes = 0 ;
6067 let mut nodes: HashMap < _ , _ , _ > = node_io_types
6168 . iter ( )
69+ . take ( input_count)
6270 . enumerate ( )
6371 . map ( |( i, inputs) | {
6472 (
You can’t perform that action at this time.
0 commit comments