@@ -1485,6 +1485,112 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
1485
1485
description: Cow :: Borrowed ( "TODO" ) ,
1486
1486
properties: None ,
1487
1487
} ,
1488
+ DocumentNodeDefinition {
1489
+ identifier: "Transform2" ,
1490
+ category: "Math: Transform" ,
1491
+ node_template: NodeTemplate {
1492
+ document_node: DocumentNode {
1493
+ inputs: vec![
1494
+ NodeInput :: value( TaggedValue :: DAffine2 ( DAffine2 :: default ( ) ) , true ) ,
1495
+ NodeInput :: value( TaggedValue :: DVec2 ( DVec2 :: ZERO ) , false ) ,
1496
+ NodeInput :: value( TaggedValue :: F64 ( 0. ) , false ) ,
1497
+ NodeInput :: value( TaggedValue :: DVec2 ( DVec2 :: ONE ) , false ) ,
1498
+ NodeInput :: value( TaggedValue :: DVec2 ( DVec2 :: ZERO ) , false ) ,
1499
+ NodeInput :: value( TaggedValue :: IndexOperationFilter ( ( 0 ..=1 ) . into( ) ) , false ) ,
1500
+ ] ,
1501
+ implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
1502
+ exports: vec![ NodeInput :: node( NodeId ( 1 ) , 0 ) ] ,
1503
+ nodes: [
1504
+ DocumentNode {
1505
+ inputs: vec![ NodeInput :: network( generic!( T ) , 0 ) ] ,
1506
+ implementation: DocumentNodeImplementation :: ProtoNode ( memo:: monitor:: IDENTIFIER ) ,
1507
+ manual_composition: Some ( generic!( T ) ) ,
1508
+ skip_deduplication: true ,
1509
+ ..Default :: default ( )
1510
+ } ,
1511
+ DocumentNode {
1512
+ inputs: vec![
1513
+ NodeInput :: node( NodeId ( 0 ) , 0 ) ,
1514
+ NodeInput :: network( concrete!( DVec2 ) , 1 ) ,
1515
+ NodeInput :: network( concrete!( f64 ) , 2 ) ,
1516
+ NodeInput :: network( concrete!( DVec2 ) , 3 ) ,
1517
+ NodeInput :: network( concrete!( DVec2 ) , 4 ) ,
1518
+ NodeInput :: network( fn_type!( Context , bool ) , 5 ) ,
1519
+ ] ,
1520
+ manual_composition: Some ( concrete!( Context ) ) ,
1521
+ implementation: DocumentNodeImplementation :: ProtoNode ( transform_nodes:: transform_two:: IDENTIFIER ) ,
1522
+ ..Default :: default ( )
1523
+ } ,
1524
+ ]
1525
+ . into_iter( )
1526
+ . enumerate( )
1527
+ . map( |( id, node) | ( NodeId ( id as u64 ) , node) )
1528
+ . collect( ) ,
1529
+ ..Default :: default ( )
1530
+ } ) ,
1531
+ ..Default :: default ( )
1532
+ } ,
1533
+ persistent_node_metadata: DocumentNodePersistentMetadata {
1534
+ network_metadata: Some ( NodeNetworkMetadata {
1535
+ persistent_metadata: NodeNetworkPersistentMetadata {
1536
+ node_metadata: [
1537
+ DocumentNodeMetadata {
1538
+ persistent_metadata: DocumentNodePersistentMetadata {
1539
+ display_name: "Monitor" . to_string( ) ,
1540
+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , 0 ) ) ,
1541
+ ..Default :: default ( )
1542
+ } ,
1543
+ ..Default :: default ( )
1544
+ } ,
1545
+ DocumentNodeMetadata {
1546
+ persistent_metadata: DocumentNodePersistentMetadata {
1547
+ display_name: "Transform" . to_string( ) ,
1548
+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 7 , 0 ) ) ,
1549
+ ..Default :: default ( )
1550
+ } ,
1551
+ ..Default :: default ( )
1552
+ } ,
1553
+ ]
1554
+ . into_iter( )
1555
+ . enumerate( )
1556
+ . map( |( id, node) | ( NodeId ( id as u64 ) , node) )
1557
+ . collect( ) ,
1558
+ ..Default :: default ( )
1559
+ } ,
1560
+ ..Default :: default ( )
1561
+ } ) ,
1562
+ input_metadata: vec![
1563
+ ( "Value" , "TODO" ) . into( ) ,
1564
+ InputMetadata :: with_name_description_override(
1565
+ "Translation" ,
1566
+ "TODO" ,
1567
+ WidgetOverride :: Vec2 ( Vec2InputSettings {
1568
+ x: "X" . to_string( ) ,
1569
+ y: "Y" . to_string( ) ,
1570
+ unit: " px" . to_string( ) ,
1571
+ ..Default :: default ( )
1572
+ } ) ,
1573
+ ) ,
1574
+ InputMetadata :: with_name_description_override( "Rotation" , "TODO" , WidgetOverride :: Custom ( "transform_rotation" . to_string( ) ) ) ,
1575
+ InputMetadata :: with_name_description_override(
1576
+ "Scale" ,
1577
+ "TODO" ,
1578
+ WidgetOverride :: Vec2 ( Vec2InputSettings {
1579
+ x: "W" . to_string( ) ,
1580
+ y: "H" . to_string( ) ,
1581
+ unit: "x" . to_string( ) ,
1582
+ ..Default :: default ( )
1583
+ } ) ,
1584
+ ) ,
1585
+ InputMetadata :: with_name_description_override( "Skew" , "TODO" , WidgetOverride :: Custom ( "transform_skew" . to_string( ) ) ) ,
1586
+ ] ,
1587
+ output_names: vec![ "Data" . to_string( ) ] ,
1588
+ ..Default :: default ( )
1589
+ } ,
1590
+ } ,
1591
+ description: Cow :: Borrowed ( "TODO" ) ,
1592
+ properties: None ,
1593
+ } ,
1488
1594
DocumentNodeDefinition {
1489
1595
identifier: "Boolean Operation" ,
1490
1596
category: "Vector" ,
0 commit comments