@@ -227,38 +227,41 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
227227 node_template: NodeTemplate {
228228 document_node: DocumentNode {
229229 implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
230- exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
230+ exports: vec![ NodeInput :: node( NodeId ( 4 ) , 0 ) ] ,
231231 nodes: [
232+ // Primary (bottom) input type coercion
233+ DocumentNode {
234+ inputs: vec![ NodeInput :: network( generic!( T ) , 0 ) ] ,
235+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: to_graphic:: IDENTIFIER ) ,
236+ manual_composition: Some ( concrete!( Context ) ) ,
237+ ..Default :: default ( )
238+ } ,
232239 // Secondary (left) input type coercion
233240 DocumentNode {
234241 inputs: vec![ NodeInput :: network( generic!( T ) , 1 ) ] ,
235- implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: to_element :: IDENTIFIER ) ,
242+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: wrap_graphic :: IDENTIFIER ) ,
236243 manual_composition: Some ( concrete!( Context ) ) ,
237244 ..Default :: default ( )
238245 } ,
239- // Primary (bottom) input type coercion
246+ // Store the ID of the parent node (which encapsulates this sub-network) in each row we are extending the table with.
240247 DocumentNode {
241- inputs: vec![ NodeInput :: network ( generic! ( T ) , 0 ) ] ,
242- implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: to_group :: IDENTIFIER ) ,
248+ inputs: vec![ NodeInput :: node ( NodeId ( 1 ) , 0 ) , NodeInput :: Reflection ( graph_craft :: document :: DocumentNodeMetadata :: DocumentNodePath ) ] ,
249+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: source_node_id :: IDENTIFIER ) ,
243250 manual_composition: Some ( concrete!( Context ) ) ,
244251 ..Default :: default ( )
245252 } ,
246253 // The monitor node is used to display a thumbnail in the UI
247254 DocumentNode {
248- inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) ] ,
255+ inputs: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
249256 implementation: DocumentNodeImplementation :: ProtoNode ( memo:: monitor:: IDENTIFIER ) ,
250257 manual_composition: Some ( concrete!( Context ) ) ,
251258 skip_deduplication: true ,
252259 ..Default :: default ( )
253260 } ,
254261 DocumentNode {
255262 manual_composition: Some ( generic!( T ) ) ,
256- inputs: vec![
257- NodeInput :: node( NodeId ( 1 ) , 0 ) ,
258- NodeInput :: node( NodeId ( 2 ) , 0 ) ,
259- NodeInput :: Reflection ( graph_craft:: document:: DocumentNodeMetadata :: DocumentNodePath ) ,
260- ] ,
261- implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: layer:: IDENTIFIER ) ,
263+ inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) , NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
264+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: extend:: IDENTIFIER ) ,
262265 ..Default :: default ( )
263266 } ,
264267 ]
@@ -275,24 +278,32 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
275278 ..Default :: default ( )
276279 } ,
277280 persistent_node_metadata: DocumentNodePersistentMetadata {
278- input_metadata: vec![ ( "Graphical Data " , "TODO" ) . into( ) , ( "Over " , "TODO" ) . into( ) ] ,
281+ input_metadata: vec![ ( "Base " , "TODO" ) . into( ) , ( "Content " , "TODO" ) . into( ) ] ,
279282 output_names: vec![ "Out" . to_string( ) ] ,
280283 node_type_metadata: NodeTypePersistentMetadata :: layer( IVec2 :: new( 0 , 0 ) ) ,
281284 network_metadata: Some ( NodeNetworkMetadata {
282285 persistent_metadata: NodeNetworkPersistentMetadata {
283286 node_metadata: [
284287 DocumentNodeMetadata {
285288 persistent_metadata: DocumentNodePersistentMetadata {
286- display_name: "To Element " . to_string( ) ,
287- node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -14 , -1 ) ) ,
289+ display_name: "To Graphic " . to_string( ) ,
290+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -21 , -3 ) ) ,
288291 ..Default :: default ( )
289292 } ,
290293 ..Default :: default ( )
291294 } ,
292295 DocumentNodeMetadata {
293296 persistent_metadata: DocumentNodePersistentMetadata {
294- display_name: "To Group" . to_string( ) ,
295- node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -14 , -3 ) ) ,
297+ display_name: "Wrap Graphic" . to_string( ) ,
298+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -21 , -1 ) ) ,
299+ ..Default :: default ( )
300+ } ,
301+ ..Default :: default ( )
302+ } ,
303+ DocumentNodeMetadata {
304+ persistent_metadata: DocumentNodePersistentMetadata {
305+ display_name: "Source Node ID" . to_string( ) ,
306+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -14 , -1 ) ) ,
296307 ..Default :: default ( )
297308 } ,
298309 ..Default :: default ( )
@@ -307,7 +318,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
307318 } ,
308319 DocumentNodeMetadata {
309320 persistent_metadata: DocumentNodePersistentMetadata {
310- display_name: "Layer " . to_string( ) ,
321+ display_name: "Extend " . to_string( ) ,
311322 node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , -3 ) ) ,
312323 ..Default :: default ( )
313324 } ,
@@ -334,12 +345,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
334345 node_template: NodeTemplate {
335346 document_node: DocumentNode {
336347 implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
337- exports: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
348+ exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
338349 nodes: [
339350 // Ensure this ID is kept in sync with the ID in set_alias so that the name input is kept in sync with the alias
340351 DocumentNode {
341352 manual_composition: Some ( generic!( T ) ) ,
342- implementation: DocumentNodeImplementation :: ProtoNode ( artboard:: to_artboard :: IDENTIFIER ) ,
353+ implementation: DocumentNodeImplementation :: ProtoNode ( artboard:: create_artboard :: IDENTIFIER ) ,
343354 inputs: vec![
344355 NodeInput :: network( concrete!( TaggedValue ) , 1 ) ,
345356 NodeInput :: value( TaggedValue :: String ( String :: from( "Artboard" ) ) , false ) ,
@@ -350,10 +361,17 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
350361 ] ,
351362 ..Default :: default ( )
352363 } ,
364+ // Store the ID of the parent node (which encapsulates this sub-network) in each row we are extending the table with.
365+ DocumentNode {
366+ inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) , NodeInput :: Reflection ( graph_craft:: document:: DocumentNodeMetadata :: DocumentNodePath ) ] ,
367+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: source_node_id:: IDENTIFIER ) ,
368+ manual_composition: Some ( concrete!( Context ) ) ,
369+ ..Default :: default ( )
370+ } ,
353371 // The monitor node is used to display a thumbnail in the UI.
354372 // TODO: Check if thumbnail is reversed
355373 DocumentNode {
356- inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) ] ,
374+ inputs: vec![ NodeInput :: node( NodeId ( 1 ) , 0 ) ] ,
357375 implementation: DocumentNodeImplementation :: ProtoNode ( memo:: monitor:: IDENTIFIER ) ,
358376 manual_composition: Some ( generic!( T ) ) ,
359377 skip_deduplication: true ,
@@ -363,10 +381,10 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
363381 manual_composition: Some ( concrete!( Context ) ) ,
364382 inputs: vec![
365383 NodeInput :: network( graphene_std:: Type :: Fn ( Box :: new( concrete!( Context ) ) , Box :: new( concrete!( Table <Artboard >) ) ) , 0 ) ,
366- NodeInput :: node( NodeId ( 1 ) , 0 ) ,
384+ NodeInput :: node( NodeId ( 2 ) , 0 ) ,
367385 NodeInput :: Reflection ( graph_craft:: document:: DocumentNodeMetadata :: DocumentNodePath ) ,
368386 ] ,
369- implementation: DocumentNodeImplementation :: ProtoNode ( artboard :: append_artboard :: IDENTIFIER ) ,
387+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic :: extend :: IDENTIFIER ) ,
370388 ..Default :: default ( )
371389 } ,
372390 ]
@@ -388,8 +406,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
388406 } ,
389407 persistent_node_metadata: DocumentNodePersistentMetadata {
390408 input_metadata: vec![
391- ( "Artboards " , "TODO" ) . into( ) ,
392- InputMetadata :: with_name_description_override( "Contents " , "TODO" , WidgetOverride :: Hidden ) ,
409+ ( "Base " , "TODO" ) . into( ) ,
410+ InputMetadata :: with_name_description_override( "Content " , "TODO" , WidgetOverride :: Hidden ) ,
393411 InputMetadata :: with_name_description_override(
394412 "Location" ,
395413 "TODO" ,
@@ -422,7 +440,15 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
422440 node_metadata: [
423441 DocumentNodeMetadata {
424442 persistent_metadata: DocumentNodePersistentMetadata {
425- display_name: "To Artboard" . to_string( ) ,
443+ display_name: "Create Artboard" . to_string( ) ,
444+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -21 , -3 ) ) ,
445+ ..Default :: default ( )
446+ } ,
447+ ..Default :: default ( )
448+ } ,
449+ DocumentNodeMetadata {
450+ persistent_metadata: DocumentNodePersistentMetadata {
451+ display_name: "Source Node ID" . to_string( ) ,
426452 node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -14 , -3 ) ) ,
427453 ..Default :: default ( )
428454 } ,
@@ -438,7 +464,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
438464 } ,
439465 DocumentNodeMetadata {
440466 persistent_metadata: DocumentNodePersistentMetadata {
441- display_name: "Append Artboards " . to_string( ) ,
467+ display_name: "Extend " . to_string( ) ,
442468 node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , -4 ) ) ,
443469 ..Default :: default ( )
444470 } ,
0 commit comments