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