@@ -227,38 +227,41 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
227
227
node_template: NodeTemplate {
228
228
document_node: DocumentNode {
229
229
implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
230
- exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
230
+ exports: vec![ NodeInput :: node( NodeId ( 4 ) , 0 ) ] ,
231
231
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
+ } ,
232
239
// Secondary (left) input type coercion
233
240
DocumentNode {
234
241
inputs: vec![ NodeInput :: network( generic!( T ) , 1 ) ] ,
235
- implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: to_element :: IDENTIFIER ) ,
242
+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic:: wrap_graphic :: IDENTIFIER ) ,
236
243
manual_composition: Some ( concrete!( Context ) ) ,
237
244
..Default :: default ( )
238
245
} ,
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.
240
247
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 ) ,
243
250
manual_composition: Some ( concrete!( Context ) ) ,
244
251
..Default :: default ( )
245
252
} ,
246
253
// The monitor node is used to display a thumbnail in the UI
247
254
DocumentNode {
248
- inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) ] ,
255
+ inputs: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
249
256
implementation: DocumentNodeImplementation :: ProtoNode ( memo:: monitor:: IDENTIFIER ) ,
250
257
manual_composition: Some ( concrete!( Context ) ) ,
251
258
skip_deduplication: true ,
252
259
..Default :: default ( )
253
260
} ,
254
261
DocumentNode {
255
262
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 ) ,
262
265
..Default :: default ( )
263
266
} ,
264
267
]
@@ -275,24 +278,32 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
275
278
..Default :: default ( )
276
279
} ,
277
280
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( ) ] ,
279
282
output_names: vec![ "Out" . to_string( ) ] ,
280
283
node_type_metadata: NodeTypePersistentMetadata :: layer( IVec2 :: new( 0 , 0 ) ) ,
281
284
network_metadata: Some ( NodeNetworkMetadata {
282
285
persistent_metadata: NodeNetworkPersistentMetadata {
283
286
node_metadata: [
284
287
DocumentNodeMetadata {
285
288
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 ) ) ,
288
291
..Default :: default ( )
289
292
} ,
290
293
..Default :: default ( )
291
294
} ,
292
295
DocumentNodeMetadata {
293
296
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 ) ) ,
296
307
..Default :: default ( )
297
308
} ,
298
309
..Default :: default ( )
@@ -307,7 +318,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
307
318
} ,
308
319
DocumentNodeMetadata {
309
320
persistent_metadata: DocumentNodePersistentMetadata {
310
- display_name: "Layer " . to_string( ) ,
321
+ display_name: "Extend " . to_string( ) ,
311
322
node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , -3 ) ) ,
312
323
..Default :: default ( )
313
324
} ,
@@ -334,12 +345,12 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
334
345
node_template: NodeTemplate {
335
346
document_node: DocumentNode {
336
347
implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
337
- exports: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
348
+ exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
338
349
nodes: [
339
350
// 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
340
351
DocumentNode {
341
352
manual_composition: Some ( generic!( T ) ) ,
342
- implementation: DocumentNodeImplementation :: ProtoNode ( artboard:: to_artboard :: IDENTIFIER ) ,
353
+ implementation: DocumentNodeImplementation :: ProtoNode ( artboard:: create_artboard :: IDENTIFIER ) ,
343
354
inputs: vec![
344
355
NodeInput :: network( concrete!( TaggedValue ) , 1 ) ,
345
356
NodeInput :: value( TaggedValue :: String ( String :: from( "Artboard" ) ) , false ) ,
@@ -350,10 +361,17 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
350
361
] ,
351
362
..Default :: default ( )
352
363
} ,
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
+ } ,
353
371
// The monitor node is used to display a thumbnail in the UI.
354
372
// TODO: Check if thumbnail is reversed
355
373
DocumentNode {
356
- inputs: vec![ NodeInput :: node( NodeId ( 0 ) , 0 ) ] ,
374
+ inputs: vec![ NodeInput :: node( NodeId ( 1 ) , 0 ) ] ,
357
375
implementation: DocumentNodeImplementation :: ProtoNode ( memo:: monitor:: IDENTIFIER ) ,
358
376
manual_composition: Some ( generic!( T ) ) ,
359
377
skip_deduplication: true ,
@@ -363,10 +381,10 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
363
381
manual_composition: Some ( concrete!( Context ) ) ,
364
382
inputs: vec![
365
383
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 ) ,
367
385
NodeInput :: Reflection ( graph_craft:: document:: DocumentNodeMetadata :: DocumentNodePath ) ,
368
386
] ,
369
- implementation: DocumentNodeImplementation :: ProtoNode ( artboard :: append_artboard :: IDENTIFIER ) ,
387
+ implementation: DocumentNodeImplementation :: ProtoNode ( graphic :: extend :: IDENTIFIER ) ,
370
388
..Default :: default ( )
371
389
} ,
372
390
]
@@ -388,8 +406,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
388
406
} ,
389
407
persistent_node_metadata: DocumentNodePersistentMetadata {
390
408
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 ) ,
393
411
InputMetadata :: with_name_description_override(
394
412
"Location" ,
395
413
"TODO" ,
@@ -422,7 +440,15 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
422
440
node_metadata: [
423
441
DocumentNodeMetadata {
424
442
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( ) ,
426
452
node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( -14 , -3 ) ) ,
427
453
..Default :: default ( )
428
454
} ,
@@ -438,7 +464,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
438
464
} ,
439
465
DocumentNodeMetadata {
440
466
persistent_metadata: DocumentNodePersistentMetadata {
441
- display_name: "Append Artboards " . to_string( ) ,
467
+ display_name: "Extend " . to_string( ) ,
442
468
node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , -4 ) ) ,
443
469
..Default :: default ( )
444
470
} ,
0 commit comments