11use super :: node_properties;
2- use super :: utility_types:: { FrontendNodeType } ;
2+ use super :: utility_types:: FrontendNodeType ;
33use crate :: messages:: layout:: utility_types:: widget_prelude:: * ;
44use 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 ,
76} ;
87use crate :: messages:: portfolio:: utility_types:: PersistentData ;
98use crate :: messages:: prelude:: Message ;
@@ -840,10 +839,10 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
840839 node_template: NodeTemplate {
841840 document_node: DocumentNode {
842841 implementation: DocumentNodeImplementation :: Network ( NodeNetwork {
843- exports: vec![ NodeInput :: node( NodeId ( 3 ) , 0 ) ] ,
842+ exports: vec![ NodeInput :: node( NodeId ( 2 ) , 0 ) ] ,
844843 nodes: [
845844 DocumentNode {
846- inputs: vec![ NodeInput :: network( concrete!( WasmEditorApi ) , 1 ) ] ,
845+ inputs: vec![ NodeInput :: network( concrete!( & WasmEditorApi ) , 1 ) ] ,
847846 implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_std::wasm_application_io::CreateSurfaceNode" ) ) ,
848847 skip_deduplication: true ,
849848 ..Default :: default ( )
@@ -854,14 +853,19 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
854853 implementation: DocumentNodeImplementation :: ProtoNode ( ProtoNodeIdentifier :: new( "graphene_core::memo::MemoNode<_, _>" ) ) ,
855854 ..Default :: default ( )
856855 } ,
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+ // },
857862 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<_, _, _>" ) ) ,
865869 ..Default :: default ( )
866870 } ,
867871 ]
@@ -880,7 +884,42 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
880884 persistent_node_metadata: DocumentNodePersistentMetadata {
881885 input_names: vec![ "Output" . to_string( ) , "In" . to_string( ) ] ,
882886 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+ } ) ,
884923 ..Default :: default ( )
885924 } ,
886925 } ,
@@ -4416,7 +4455,7 @@ impl DocumentNodeDefinition {
44164455 input_override. into_iter ( ) . enumerate ( ) . for_each ( |( index, input_override) | {
44174456 if let Some ( input_override) = input_override {
44184457 // 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");
44204459 template. document_node . inputs [ index] = input_override;
44214460 }
44224461 } ) ;
0 commit comments