@@ -10,7 +10,6 @@ use graph_craft::document::DocumentNode;
1010use graph_craft:: document:: { DocumentNodeImplementation , NodeInput , value:: TaggedValue } ;
1111use graphene_std:: ProtoNodeIdentifier ;
1212use graphene_std:: subpath:: Subpath ;
13- use graphene_std:: table:: Table ;
1413use graphene_std:: text:: { TextAlign , TypesettingConfig } ;
1514use graphene_std:: transform:: ScaleType ;
1615use graphene_std:: uuid:: NodeId ;
@@ -585,8 +584,9 @@ const NODE_REPLACEMENTS: &[NodeReplacement<'static>] = &[
585584 ] ,
586585 } ,
587586 NodeReplacement {
588- node : graphene_std:: raster_nodes:: std_nodes:: image_value :: IDENTIFIER ,
587+ node : graphene_std:: raster_nodes:: std_nodes:: image :: IDENTIFIER ,
589588 aliases : & [
589+ "raster_nodes::std_nodes::ImageValueNode" ,
590590 "graphene_raster_nodes::std_nodes::ImageValueNode" ,
591591 "graphene_std::raster::ImageValueNode" ,
592592 "graphene_std::raster::ImageNode" ,
@@ -1140,10 +1140,8 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
11401140 log:: error!( "Path node does not exist." ) ;
11411141 return None ;
11421142 } ;
1143- let path_node = path_node_type. node_template_input_override ( [
1144- Some ( NodeInput :: value ( TaggedValue :: Vector ( Table :: new_from_element ( vector) ) , true ) ) ,
1145- Some ( NodeInput :: value ( TaggedValue :: VectorModification ( Default :: default ( ) ) , false ) ) ,
1146- ] ) ;
1143+ let modification = Box :: new ( graphene_std:: vector:: VectorModification :: create_from_vector ( & vector) ) ;
1144+ let path_node = path_node_type. node_template_input_override ( [ None , Some ( NodeInput :: value ( TaggedValue :: VectorModification ( modification) , false ) ) ] ) ;
11471145
11481146 // Get the "Spline" node definition and wire it up with the "Path" node as input
11491147 let Some ( spline_node_type) = resolve_proto_node_type ( graphene_std:: vector:: spline:: IDENTIFIER ) else {
@@ -1387,7 +1385,7 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
13871385 . set_input ( & InputConnector :: node ( NodeId ( 0 ) , 1 ) , NodeInput :: value ( TaggedValue :: String ( label) , false ) , & [ * node_id] ) ;
13881386 }
13891387
1390- if reference == DefinitionIdentifier :: ProtoNode ( graphene_std:: raster_nodes:: std_nodes:: image_value :: IDENTIFIER ) && inputs_count == 1 {
1388+ if reference == DefinitionIdentifier :: ProtoNode ( graphene_std:: raster_nodes:: std_nodes:: image :: IDENTIFIER ) && inputs_count == 1 {
13911389 let mut node_template = resolve_document_node_type ( & reference) ?. default_node_template ( ) ;
13921390 document. network_interface . replace_implementation ( node_id, network_path, & mut node_template) ;
13931391
@@ -1952,6 +1950,42 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
19521950 . set_input ( & InputConnector :: node ( * node_id, 3 ) , NodeInput :: value ( TaggedValue :: Bool ( false ) , false ) , network_path) ;
19531951 }
19541952
1953+ // Migrate Path nodes that stored geometry directly in input 0 (as a Table<Vector>) to instead use a VectorModification in input 1
1954+ if reference == DefinitionIdentifier :: Network ( "Path" . into ( ) ) {
1955+ let input_0 = node. inputs . first ( ) ?;
1956+ if let NodeInput :: Value { tagged_value, exposed } = input_0
1957+ && !exposed
1958+ && let TaggedValue :: Vector ( vector_table) = & * * tagged_value
1959+ && !vector_table. is_empty ( )
1960+ {
1961+ let vector = vector_table. iter ( ) . next ( ) ?. element ;
1962+ let modification = Box :: new ( graphene_std:: vector:: VectorModification :: create_from_vector ( vector) ) ;
1963+
1964+ // Reset input 0 to the default exposed state
1965+ document
1966+ . network_interface
1967+ . set_input ( & InputConnector :: node ( * node_id, 0 ) , NodeInput :: value ( TaggedValue :: Vector ( Default :: default ( ) ) , true ) , network_path) ;
1968+
1969+ // Store the converted VectorModification in input 1
1970+ document
1971+ . network_interface
1972+ . set_input ( & InputConnector :: node ( * node_id, 1 ) , NodeInput :: value ( TaggedValue :: VectorModification ( modification) , false ) , network_path) ;
1973+ }
1974+ }
1975+
1976+ // Migrate Image nodes that stored a Table<Raster<CPU>> in input 1 to instead use bare Image<Color> via TaggedValue::ImageData
1977+ if reference == DefinitionIdentifier :: ProtoNode ( graphene_std:: raster_nodes:: std_nodes:: image:: IDENTIFIER )
1978+ && let Some ( NodeInput :: Value { tagged_value, .. } ) = node. inputs . get ( 1 )
1979+ && let TaggedValue :: Raster ( raster_table) = & * * tagged_value
1980+ && let Some ( row) = raster_table. iter ( ) . next ( )
1981+ {
1982+ let image = row. element . data ( ) . clone ( ) ;
1983+
1984+ document
1985+ . network_interface
1986+ . set_input ( & InputConnector :: node ( * node_id, 1 ) , NodeInput :: value ( TaggedValue :: ImageData ( image) , false ) , network_path) ;
1987+ }
1988+
19551989 // ==================================
19561990 // PUT ALL MIGRATIONS ABOVE THIS LINE
19571991 // ==================================
0 commit comments