1
1
use super :: node_properties;
2
- use super :: utility_types:: { FrontendNodeType } ;
2
+ use super :: utility_types:: FrontendNodeType ;
3
3
use crate :: messages:: layout:: utility_types:: widget_prelude:: * ;
4
4
use crate :: messages:: portfolio:: document:: utility_types:: network_interface:: {
5
- DocumentNodeMetadata , DocumentNodePersistentMetadata , NodeNetworkInterface , NodeNetworkMetadata ,
6
- NodeNetworkPersistentMetadata , NodeTemplate , NodeTypePersistentMetadata ,
5
+ DocumentNodeMetadata , DocumentNodePersistentMetadata , NodeNetworkInterface , NodeNetworkMetadata , NodeNetworkPersistentMetadata , NodeTemplate , NodeTypePersistentMetadata ,
7
6
} ;
8
7
use crate :: messages:: portfolio:: utility_types:: PersistentData ;
9
8
use crate :: messages:: prelude:: Message ;
@@ -840,10 +839,10 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
840
839
node_template: NodeTemplate {
841
840
document_node: DocumentNode {
842
841
implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
843
- exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
842
+ exports: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
844
843
nodes: [
845
844
DocumentNode {
846
- inputs: vec![ NodeInput :: network( concrete!( WasmEditorApi ) , 1 ) ] ,
845
+ inputs: vec![ NodeInput :: network( concrete!( & WasmEditorApi ) , 1 ) ] ,
847
846
implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_std::wasm_application_io::CreateSurfaceNode" ) ) ,
848
847
skip_deduplication: true ,
849
848
..Default :: default ( )
@@ -854,14 +853,19 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
854
853
implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_core::memo::MemoNode<_, _>" ) ) ,
855
854
..Default :: default ( )
856
855
} ,
856
+ // TODO: Add conversion step
857
+ // DocumentNode {
858
+ // inputs: vec![NodeInput::network(graphene_core::Type::Fn(Box::new(concrete!(Footprint)), Box::new(generic!(T))), 0)],
859
+ // implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::ops::IntoNode<_, GraphicGroup>")),
860
+ // ..Default::default()
861
+ // },
857
862
DocumentNode {
858
- inputs: vec![ NodeInput :: network( graphene_core:: Type :: Fn ( Box :: new( concrete!( Footprint ) ) , Box :: new( generic!( T ) ) ) , 0 ) ] ,
859
- implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_core::ops::IntoNode<_, GraphicGroup>" ) ) ,
860
- ..Default :: default ( )
861
- } ,
862
- DocumentNode {
863
- inputs: vec![ NodeInput :: network( concrete!( WasmEditorApi ) , 1 ) , NodeInput :: node( NodeId ( 2 ) , 0 ) , NodeInput :: node( NodeId ( 1 ) , 0 ) ] ,
864
- implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_std::wasm_application_io::RenderNode<_, _>" ) ) ,
863
+ inputs: vec![
864
+ NodeInput :: network( concrete!( WasmEditorApi ) , 1 ) ,
865
+ NodeInput :: network( graphene_core:: Type :: Fn ( Box :: new( concrete!( Footprint ) ) , Box :: new( generic!( T ) ) ) , 0 ) ,
866
+ NodeInput :: node( NodeId ( 1 ) , 0 ) ,
867
+ ] ,
868
+ implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_std::wasm_application_io::RenderNode<_, _, _>" ) ) ,
865
869
..Default :: default ( )
866
870
} ,
867
871
]
@@ -880,7 +884,42 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
880
884
persistent_node_metadata: DocumentNodePersistentMetadata {
881
885
input_names: vec![ "Output" . to_string( ) , "In" . to_string( ) ] ,
882
886
output_names: vec![ ] ,
883
- network_metadata: Some ( NodeNetworkMetadata :: default ( ) ) ,
887
+ network_metadata: Some ( NodeNetworkMetadata {
888
+ persistent_metadata: NodeNetworkPersistentMetadata {
889
+ node_metadata: [
890
+ DocumentNodeMetadata {
891
+ persistent_metadata: DocumentNodePersistentMetadata {
892
+ display_name: "Create Canvas" . to_string( ) ,
893
+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , 0 ) ) ,
894
+ ..Default :: default ( )
895
+ } ,
896
+ ..Default :: default ( )
897
+ } ,
898
+ DocumentNodeMetadata {
899
+ persistent_metadata: DocumentNodePersistentMetadata {
900
+ display_name: "Cache" . to_string( ) ,
901
+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , 0 ) ) ,
902
+ ..Default :: default ( )
903
+ } ,
904
+ ..Default :: default ( )
905
+ } ,
906
+ DocumentNodeMetadata {
907
+ persistent_metadata: DocumentNodePersistentMetadata {
908
+ display_name: "RenderNode" . to_string( ) ,
909
+ node_type_metadata: NodeTypePersistentMetadata :: node( IVec2 :: new( 0 , 0 ) ) ,
910
+ ..Default :: default ( )
911
+ } ,
912
+ ..Default :: default ( )
913
+ } ,
914
+ ]
915
+ . into_iter( )
916
+ . enumerate( )
917
+ . map( |( id, node) | ( NodeId ( id as u64 ) , node) )
918
+ . collect( ) ,
919
+ ..Default :: default ( )
920
+ } ,
921
+ ..Default :: default ( )
922
+ } ) ,
884
923
..Default :: default ( )
885
924
} ,
886
925
} ,
@@ -4416,7 +4455,7 @@ impl DocumentNodeDefinition {
4416
4455
input_override. into_iter ( ) . enumerate ( ) . for_each ( |( index, input_override) | {
4417
4456
if let Some ( input_override) = input_override {
4418
4457
// Only value inputs can be overridden, since node inputs change graph structure and must be handled by the network interface
4419
- assert ! ( matches!( input_override, NodeInput :: Value { .. } ) , "Only value inputs are supported for input overrides" ) ;
4458
+ // assert!(matches!(input_override, NodeInput::Value { .. }), "Only value inputs are supported for input overrides");
4420
4459
template. document_node . inputs [ index] = input_override;
4421
4460
}
4422
4461
} ) ;
0 commit comments