mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-12-01 07:24:56 -10:00
Rename NodeNetwork inputs/outputs to imports/exports
This commit is contained in:
1 parent
137853eb40
commit
fd54cda445
17 files changed
+166
-164
No files matched your search
@@ -1 +1 @@
|
||||
{"network":{"inputs":[],"outputs":[{"node_id":0,"node_output_index":0}],"nodes":{"14324050045182807492":{"alias":"","name":"Blend Mode","inputs":[{"Node":{"node_id":383,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"BlendMode":"SoftLight"},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::raster::BlendModeNode<_>"}},"metadata":{"position":[-50,163]},"skip_deduplication":false,"world_state_hash":0},"89":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":91,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[-330.46785325927567,-316.526427710171]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.669043},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[3.2083624493340843,0.05852766346593507]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0813762493304704e-18,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[-55,22]},"skip_deduplication":false,"world_state_hash":0},"314":{"alias":"","name":"Shape","inputs":[{"Value":{"tagged_value":{"Subpaths":[{"manipulator_groups":[{"anchor":[-288.0,-59.0],"in_handle":[-273.0,-65.0],"out_handle":[-288.0,-59.0],"id":10569360655845209926},{"anchor":[-312.01196180016336,-34.0],"in_handle":[-301.555683936979,-37.0],"out_handle":[-312.01196180016336,-34.0],"id":5370317804571493554},{"anchor":[-302.0,-22.0],"in_handle":[-312.4479023106836,-20.0],"out_handle":[-302.0,-22.0],"id":8571758303693928861},{"anchor":[-281.9999999999999,-31.0],"in_handle":[-281.9999999999999,-31.0],"out_handle":[-281.9999999999999,-31.0],"id":4767358240984635899},{"anchor":[-268.0,-53.0],"in_handle":[-272.0,-44.0],"out_handle":[-268.0,-53.0],"id":17331125447306380061}],"closed":true}]},"exposed":false}},{"Value":{"tagged_value":{"ManipulatorGroupIds":[13613351525647208695]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"inputs":[0,0],"outputs":[{"node_id":1,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Path Generator","inputs":[{"Network":{"Concrete":{"name":"alloc::vec::Vec<bezier_rs::subpath::Subpath<graphene_core::uuid::ManipulatorGroupId>>","size":12,"align":4}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<graphene_core::uuid::ManipulatorGroupId>","size":12,"align":4}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::generator_nodes::PathGenerator<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Cull","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::CullNode<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-66,127]},"skip_deduplication":false,"world_state_hash":0},"258":{"alias":"","name":"Shape","inputs":[{"Value":{"tagged_value":{"Subpaths":[{"manipulator_groups":[{"anchor":[0.0,0.0],"in_handle":[0.0,0.0],"out_handle":[0.0,0.0],"id":16003054759196587289},{"anchor":[1.0,0.0],"in_handle":[1.0,0.0],"out_handle":[1.0,0.0],"id":13760661972493125993}],"closed":false}]},"exposed":false}},{"Value":{"tagged_value":{"ManipulatorGroupIds":[]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"inputs":[0,0],"outputs":[{"node_id":1,"node_output_index":0}],"nodes":{"1":{"alias":"","name":"Cull","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::CullNode<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"0":{"alias":"","name":"Path Generator","inputs":[{"Network":{"Concrete":{"name":"alloc::vec::Vec<bezier_rs::subpath::Subpath<graphene_core::uuid::ManipulatorGroupId>>","size":12,"align":4}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<graphene_core::uuid::ManipulatorGroupId>","size":12,"align":4}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::generator_nodes::PathGenerator<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-71,100]},"skip_deduplication":false,"world_state_hash":0},"266":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":269,"outLine truncated
|
||||
{"network":{"imports":[],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"212":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":215,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.8117647,"green":0.16470589,"blue":0.29411766,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"F64":2.0},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"LineCap":"Round"},"exposed":false}},{"Value":{"tagged_value":{"LineJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-39,79]},"skip_deduplication":false,"world_state_hash":0},"64":{"alias":"","name":"Layer","inputs":[{"Node":{"node_id":123,"output_index":0,"lambda":false}},{"Node":{"node_id":65,"output_index":0,"lambda":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,2],"exports":[{"node_id":2,"node_output_index":0}],"nodes":{"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":12,"align":4}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-31,40]},"skip_deduplication":false,"world_state_hash":0},"117":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":120,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.85490197,"green":0.23529412,"blue":0.23529412,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"F64":2.0},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"LineCap":"Round"},"exposed":false}},{"Value":{"tagged_value":{"LineJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-39,37]},"skip_deduplication":false,"world_state_hash":0},"377":{"alias":"","name":"Shape","inputs":[{"Value":{"tagged_value":{"Subpaths":[{"manipulator_groups":[{"anchor":[-273.6332712752877,-92.0],"in_handle":[-273.6332712752877,-92.0],"out_handle":[-273.6332712752877,-92.0],"id":7796374022120372492},{"anchor":[-273.6332712752877,-228.99999999999991],"in_handle":[-269.93320921724217,-161.28707661649986],"out_handle":[-277.33333333333326,-296.71292338349997],"id":6575125059827765389},{"anchor":[-262.5843621399178,-369.514403292181],"in_handle":[-262.5843621399178,-369.514403292181],"out_handle":[-262.5843621399178,-369.514403292181],"id":11228681553338257744}],"closed":false}]},"exposed":false}},{"Value":{"tagged_value":{"ManipulatorGroupIds":[6575125059827765389]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,0],"exports":[{"node_id":1,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Path Generator","inputs":[{"Network":{"Concrete":{"name":"alloc::vec::Vec<bezier_rs::subpath::Subpath<graphene_core::uuid::ManipulatorGroupId>>","size":12,"align":4}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<graphene_core::uuid::ManipulatorGroupId>","size":12,"align":4}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::generator_nodes::PathGenerator<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Cull","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::FLine truncated
|
||||
@@ -1 +1 @@
|
||||
{"network":{"inputs":[],"outputs":[{"node_id":0,"node_output_index":0}],"nodes":{"4331062027851128032":{"alias":"","name":"Fill","inputs":[{"Node":{"node_id":17502675364388740750,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"FillType":"Gradient"},"exposed":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":1.0,"green":0.0,"blue":1.0,"alpha":0.5}},"exposed":false}},{"Value":{"tagged_value":{"GradientType":"Linear"},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.3769992978075994,0.1888891278143931]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.9861902161192166,0.9200728483862376]},"exposed":false}},{"Value":{"tagged_value":{"DAffine2":[801.0625,0.0,0.0,820.5871973335948,698.0,185.0]},"exposed":false}},{"Value":{"tagged_value":{"GradientPositions":[[0.0,{"red":0.1764706,"green":0.25882354,"blue":0.32156864,"alpha":1.0}],[1.0,{"red":0.16577148,"green":0.37890625,"blue":0.36788198,"alpha":1.0}]]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetFillNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-20,64]},"skip_deduplication":false,"world_state_hash":0},"13449829627181121540":{"alias":"","name":"Fill","inputs":[{"Node":{"node_id":5510431876617456229,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"FillType":"Gradient"},"exposed":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.8862745,"green":0.16470589,"blue":0.16470589,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"GradientType":"Radial"},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.4915209831246563,0.36613756613756576]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.49551110871305326,0.9947089947089944]},"exposed":false}},{"Value":{"tagged_value":{"DAffine2":[250.61867799546343,0.0,0.0,472.4999999999999,809.8156610022683,336.0000000000002]},"exposed":false}},{"Value":{"tagged_value":{"GradientPositions":[[0.0,{"red":0.91796875,"green":0.68489075,"blue":0.68489075,"alpha":1.0}],[1.0,{"red":0.8862745,"green":0.16470589,"blue":0.16470589,"alpha":1.0}]]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetFillNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-29,34]},"skip_deduplication":false,"world_state_hash":0},"1488551925732670841":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":3773322085315920844,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"OptionalColor":null},"exposed":false}},{"Value":{"tagged_value":{"F64":5.0},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"LineCap":"Butt"},"exposed":false}},{"Value":{"tagged_value":{"LineJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-12,58]},"skip_deduplication":false,"world_state_hash":0},"15889416971203221938":{"alias":"","name":"Fill","inputs":[{"Node":{"node_id":7331575674671647159,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"FillType":"Solid"},"exposed":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.89411765,"green":0.654902,"blue":0.0,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"GradientType":"Linear"},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DAffine2":[1.0,0.0,0.0,1.0,0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"GradientPositions":[[0.0,{"red":0.0,"green":0.0,"blue":0.0,"alpha":1.0}],[1.0,{"red":1.0,"green":1.0,"blue":1.0,"alpha":1.0}]]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetFillNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-20,61]},"skip_deduplication":false,"world_state_hash":0},"17502675364388740750":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":665049002420596388,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[426.3181429104577,532.1958874904515]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.9777789484064812,1.9777789484064812]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"Network":{"inputs":[0,1,1,1,1,1],"outputs":[{"node_id":1,"node_output_index":0}],"nodes":{"1":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}},{"Network":{"CoLine truncated
|
||||
{"network":{"imports":[],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"11777015489064910999":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":10118219203151732555,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[674.6856534818176,354.3276280850499]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[19.575820179122296,20.31995768166037]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"Network":{"imports":[0,1,1,1,1,1],"exports":[{"node_id":1,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Monitor","inputs":[{"Network":{"Concrete":{"name":"graphene_core::vector::vector_data::VectorData","size":256,"align":8}}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"1":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"f64","size":4,"align":4}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-35,37]},"skip_deduplication":false,"world_state_hash":0},"15889416971203221938":{"alias":"","name":"Fill","inputs":[{"Node":{"node_id":7331575674671647159,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"FillType":"Solid"},"exposed":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.89411765,"green":0.654902,"blue":0.0,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"GradientType":"Linear"},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DAffine2":[1.0,0.0,0.0,1.0,0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"GradientPositions":[[0.0,{"red":0.0,"green":0.0,"blue":0.0,"alpha":1.0}],[1.0,{"red":1.0,"green":1.0,"blue":1.0,"alpha":1.0}]]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetFillNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-20,61]},"skip_deduplication":false,"world_state_hash":0},"15465970086096837636":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":7048483757289392371,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[8.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,1.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"Network":{"imports":[0,1,1,1,1,1],"exports":[{"node_id":1,"node_output_index":0}],"nodes":{"1":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"f64","size":4,"align":4}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"0":{"alias":"","name":"Monitor","inputs":[{"Network":{"Concrete":{"name":"graphene_core::vector::vector_data::VectorData","size":256,"align":8}}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"pLine truncated
|
||||
@@ -1 +1 @@
|
||||
{"network":{"inputs":[],"outputs":[{"node_id":0,"node_output_index":0}],"nodes":{"4479074488343511985":{"alias":"","name":"Fill","inputs":[{"Node":{"node_id":11479098559726891734,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"FillType":"Solid"},"exposed":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.8980392,"green":0.8,"blue":0.6156863,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"GradientType":"Linear"},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,0.5]},"exposed":false}},{"Value":{"tagged_value":{"DAffine2":[1.0,0.0,0.0,1.0,0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"GradientPositions":[[0.0,{"red":0.0,"green":0.0,"blue":0.0,"alpha":1.0}],[1.0,{"red":1.0,"green":1.0,"blue":1.0,"alpha":1.0}]]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetFillNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[-22,85]},"skip_deduplication":false,"world_state_hash":0},"11451028343967836482":{"alias":"","name":"Layer","inputs":[{"Node":{"node_id":12531351117929704587,"output_index":0,"lambda":false}},{"Node":{"node_id":2422139482859833437,"output_index":0,"lambda":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"inputs":[0,2],"outputs":[{"node_id":2,"node_output_index":0}],"nodes":{"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":72,"align":8}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-15,121]},"skip_deduplication":false,"world_state_hash":0},"14225285635863713990":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":8410534738018320047,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[25.333333333333485,12.641975308641918]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,1.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"Network":{"inputs":[0,1,1,1,1,1],"outputs":[{"node_id":1,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Monitor","inputs":[{"Network":{"Concrete":{"name":"graphene_core::vector::vector_data::VectorData","size":256,"align":8}}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"1":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"f64","size":4,"align":4}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}},{"Network":{"Concrete":{"name":"glam::f64::dvec2::DVec2","size":16,"align":8}}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-29,10]},"skip_deduplication":false,"world_state_hash":0},"1659518581611333812":{"alias":"","name":"Shape","inputs":[{"Value":{"tagged_value":{"Subpaths":[{"manipulator_groups":[{"anchor":[889.8106995884773,368.4609053497942],"in_handle":[880.4609053497942,372.6748971193415],"out_handle":[899.16049Line truncated
|
||||
{"network":{"imports":[],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"11656581020969095354":{"alias":"","name":"Layer","inputs":[{"Node":{"node_id":10550662778443296023,"output_index":0,"lambda":false}},{"Node":{"node_id":8413863870096329943,"output_index":0,"lambda":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,2],"exports":[{"node_id":2,"node_output_index":0}],"nodes":{"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":72,"align":8}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-15,211]},"skip_deduplication":false,"world_state_hash":0},"6580280438672662494":{"alias":"","name":"Layer","inputs":[{"Node":{"node_id":14598755603287563819,"output_index":0,"lambda":false}},{"Node":{"node_id":15395954548128560685,"output_index":0,"lambda":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,2],"exports":[{"node_id":2,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":72,"align":8}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-15,112]},"skip_deduplication":false,"world_state_hash":0},"6645255982686652881":{"alias":"","name":"Shape","inputs":[{"Value":{"tagged_value":{"Subpaths":[{"manipulator_groups":[{"anchor":[0.5,0.0],"in_handle":[0.224107611110493,0.0],"out_handle":[0.7758923888895071,0.0],"id":3008327747181891301},{"anchor":[1.0,0.5],"in_handle":[1.0,0.224107611110493],"out_handle":[1.0,0.7758923888895071],"id":9289645726466448216},{"anchor":[0.5,1.0],"in_handle":[0.7758923888895071,1.0],"out_handle":[0.224107611110493,1.0],"id":1700543956076422935},{"anchor":[0.0,0.5],"in_handle":[0.0,0.7758923888895071],"out_handle":[0.0,0.224107611110493],"id":5695014198659903131}],"closed":true}]},"exposed":false}},{"Value":{"tagged_value":{"ManipulatorGroupIds":[3008327747181891301,9289645726466448216,1700543956076422935,5695014198659903131]},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,0],"exports":[{"node_id":1,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Path Generator","inputs":[{"Network":{"Concrete":{"name":"alloc::vec::Vec<bezier_rs::subpath::Subpath<graphene_core::uuid::ManipulatorGroupId>>","size":12,"align":4}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<graphene_core::uuid::ManipulatorGroupId>","size":12,"align":4}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::generator_nodes::PathGenerator<_>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Cull","inputs":[{"Node":{"node_id":0,"output_Line truncated
|
||||
@@ -1 +1 @@
|
||||
{"network":{"inputs":[],"outputs":[{"node_id":0,"node_output_index":0}],"nodes":{"462":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":463,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[-8.0,2.6666666666]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,1.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[-39,223]},"skip_deduplication":false,"world_state_hash":0},"158":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":159,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,1.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[-39,66]},"skip_deduplication":false,"world_state_hash":0},"15277819403265847073":{"alias":"","name":"Layer","inputs":[{"Node":{"node_id":13144340938064369470,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"GraphicGroup":{"elements":[],"transform":[1.0,0.0,0.0,1.0,0.0,0.0],"alpha_blending":{"opacity":1.0,"blend_mode":"Normal"}}},"exposed":true}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"inputs":[0,2],"outputs":[{"node_id":2,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Generic":"T"},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0},"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":72,"align":8}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-28,163]},"skip_deduplication":false,"world_state_hash":0},"161":{"alias":"Rocky Outcropping","name":"Layer","inputs":[{"Node":{"node_id":168,"output_index":0,"lambda":false}},{"Node":{"node_id":162,"output_index":0,"lambda":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"inputs":[0,2],"outputs":[{"node_id":2,"node_output_index":0}],"nodes":{"2":{"alias":"","name":"ConstructLayer","inputs":[{"Node":{"node_id":1,"output_index":0,"lambda":false}},{"Network":{"Fn":[{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},{"Concrete":{"name":"graphene_core::graphic_element::GraphicGroup","size":12,"align":4}}]}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ConstructLayerNode<_, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"0":{"alias":"","name":"To Graphic Element","inputs":[{"Network":{"Generic":"T"}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::ToGraphicElementNode"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0},"1":{"alias":"","name":"Monitor","inputs":[{"Node":{"node_id":0,"output_index":0,"lambda":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::memo::MonitorNode<_, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":true,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-15,73]},"skip_deduplicationLine truncated
|
||||
{"network":{"imports":[],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"193":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":191,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[985.8766992358352,535.2761179378668]},"exposed":false}},{"Value":{"tagged_value":{"F64":-1.7199705},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[17.59013219658168,55.4710031020387]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[-0.12623993859136262,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[-44,79]},"skip_deduplication":false,"world_state_hash":0},"187":{"alias":"","name":"Transform","inputs":[{"Node":{"node_id":188,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[1.0,1.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.0,0.0]},"exposed":false}},{"Value":{"tagged_value":{"DVec2":[0.5,0.5]},"exposed":false}}],"manual_composition":{"Concrete":{"name":"graphene_core::transform::Footprint","size":72,"align":8}},"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::transform::TransformNode<_, _, _, _, _, _>"}},"metadata":{"position":[-44,76]},"skip_deduplication":false,"world_state_hash":0},"404":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":402,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.24313726,"green":0.18431373,"blue":0.19215687,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"F64":2.0},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"LineCap":"Butt"},"exposed":false}},{"Value":{"tagged_value":{"LineJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,0,0,0,0,0,0,0],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Stroke_impl","inputs":[{"Network":{"Concrete":{"name":"graphene_core::vector::vector_data::VectorData","size":0,"align":0}}},{"Network":{"Concrete":{"name":"core::option::Option<graphene_core::raster::color::Color>","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<f64>","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}},{"Network":{"Concrete":{"name":"graphene_core::vector::style::LineCap","size":0,"align":0}}},{"Network":{"Concrete":{"name":"graphene_core::vector::style::LineJoin","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"}},"metadata":{"position":[0,0]},"skip_deduplication":false,"world_state_hash":0}},"disabled":[],"previous_outputs":null}},"metadata":{"position":[-28,175]},"skip_deduplication":false,"world_state_hash":0},"444":{"alias":"","name":"Stroke","inputs":[{"Node":{"node_id":442,"output_index":0,"lambda":false}},{"Value":{"tagged_value":{"OptionalColor":{"red":0.0,"green":0.0,"blue":0.0,"alpha":1.0}},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"VecF64":[]},"exposed":false}},{"Value":{"tagged_value":{"F64":0.0},"exposed":false}},{"Value":{"tagged_value":{"LineCap":"Butt"},"exposed":false}},{"Value":{"tagged_value":{"LineJoin":"Miter"},"exposed":false}},{"Value":{"tagged_value":{"F64":4.0},"exposed":false}}],"manual_composition":null,"has_primary_output":true,"implementation":{"Network":{"imports":[0,0,0,0,0,0,0,0],"exports":[{"node_id":0,"node_output_index":0}],"nodes":{"0":{"alias":"","name":"Stroke_impl","inputs":[{"Network":{"Concrete":{"name":"graphene_core::vector::vector_data::VectorData","size":0,"align":0}}},{"Network":{"Concrete":{"name":"core::option::Option<graphene_core::raster::color::Color>","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}},{"Network":{"Concrete":{"name":"alloc::vec::Vec<f64>","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}},{"Network":{"Concrete":{"name":"graphene_core::vector::style::LineCap","size":0,"align":0}}},{"Network":{"Concrete":{"name":"graphene_core::vector::style::LineJoin","size":0,"align":0}}},{"Network":{"Concrete":{"name":"f64","size":0,"align":0}}}],"manual_composition":null,"has_primary_output":true,"implementation":{"ProtoNode":{"name":"graphene_core::vector::SetStrokeNode<_, _, _, _, _, _, _>"}},"metadata":{"pLine truncated
|
||||
@@ -179,8 +179,8 @@ fn root_network() -> NodeNetwork {
|
||||
name: "Output".into(),
|
||||
inputs: vec![NodeInput::value(TaggedValue::GraphicGroup(Default::default()), true), NodeInput::Network(concrete!(WasmEditorApi))],
|
||||
implementation: graph_craft::document::DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(3), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
imports: vec![NodeId(3), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "EditorApi".to_string(),
|
||||
|
||||
+3
-3
@@ -269,7 +269,7 @@ impl<'a> ModifyInputsContext<'a> {
|
||||
|
||||
/// Inserts a new node and modifies the inputs
|
||||
fn modify_new_node(&mut self, name: &'static str, update_input: impl FnOnce(&mut Vec<NodeInput>, NodeId, &DocumentMetadata)) {
|
||||
let output_node_id = self.layer_node.unwrap_or(self.document_network.outputs[0].node_id);
|
||||
let output_node_id = self.layer_node.unwrap_or(self.document_network.exports[0].node_id);
|
||||
let Some(output_node) = self.document_network.nodes.get_mut(&output_node_id) else {
|
||||
warn!("Output node doesn't exist");
|
||||
return;
|
||||
@@ -302,7 +302,7 @@ impl<'a> ModifyInputsContext<'a> {
|
||||
.document_network
|
||||
.upstream_flow_back_from_nodes(
|
||||
self.layer_node
|
||||
.map_or_else(|| self.document_network.outputs.iter().map(|output| output.node_id).collect(), |id| vec![id]),
|
||||
.map_or_else(|| self.document_network.exports.iter().map(|output| output.node_id).collect(), |id| vec![id]),
|
||||
true,
|
||||
)
|
||||
.find(|(node, _)| node.name == name)
|
||||
@@ -327,7 +327,7 @@ impl<'a> ModifyInputsContext<'a> {
|
||||
.document_network
|
||||
.upstream_flow_back_from_nodes(
|
||||
self.layer_node
|
||||
.map_or_else(|| self.document_network.outputs.iter().map(|output| output.node_id).collect(), |id| vec![id]),
|
||||
.map_or_else(|| self.document_network.exports.iter().map(|output| output.node_id).collect(), |id| vec![id]),
|
||||
true,
|
||||
)
|
||||
.filter(|(node, _)| node.name == name)
|
||||
|
||||
@@ -179,7 +179,7 @@ impl NodeGraphMessageHandler {
|
||||
let mut widgets = Vec::new();
|
||||
|
||||
// Don't allow disabling input or output nodes
|
||||
let mut selection = selected_nodes.selected_nodes().filter(|&&id| !network.inputs.contains(&id) && !network.original_outputs_contain(id));
|
||||
let mut selection = selected_nodes.selected_nodes().filter(|&&id| !network.imports.contains(&id) && !network.original_outputs_contain(id));
|
||||
|
||||
// If there is at least one other selected node then show the hide or show button
|
||||
if selection.next().is_some() {
|
||||
@@ -422,7 +422,7 @@ impl NodeGraphMessageHandler {
|
||||
}
|
||||
|
||||
fn remove_references_from_network(network: &mut NodeNetwork, deleting_node_id: NodeId, reconnect: bool) -> bool {
|
||||
if network.inputs.contains(&deleting_node_id) {
|
||||
if network.imports.contains(&deleting_node_id) {
|
||||
warn!("Deleting input node!");
|
||||
return false;
|
||||
}
|
||||
@@ -959,7 +959,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||
if let Some(network) = document_network.nested_network_mut(&self.network) {
|
||||
if !hidden {
|
||||
network.disabled.retain(|&id| node_id != id);
|
||||
} else if !network.inputs.contains(&node_id) && !network.original_outputs().iter().any(|output| output.node_id == node_id) {
|
||||
} else if !network.imports.contains(&node_id) && !network.original_outputs().iter().any(|output| output.node_id == node_id) {
|
||||
network.disabled.push(node_id);
|
||||
}
|
||||
|
||||
@@ -991,10 +991,10 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||
if let Some(network) = document_network.nested_network_mut(&self.network) {
|
||||
// Check if the node is not already being previewed
|
||||
if !network.outputs_contain(node_id) {
|
||||
network.previous_outputs = Some(network.previous_outputs.to_owned().unwrap_or_else(|| network.outputs.clone()));
|
||||
network.outputs[0] = NodeOutput::new(node_id, 0);
|
||||
network.previous_outputs = Some(network.previous_outputs.to_owned().unwrap_or_else(|| network.exports.clone()));
|
||||
network.exports[0] = NodeOutput::new(node_id, 0);
|
||||
} else if let Some(outputs) = network.previous_outputs.take() {
|
||||
network.outputs = outputs
|
||||
network.exports = outputs
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
+69
-69
@@ -197,8 +197,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Layer",
|
||||
category: "General",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(2)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0), NodeId(2)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(0),
|
||||
@@ -279,8 +279,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Load Image",
|
||||
category: "Structural",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Load Resource".to_string(),
|
||||
@@ -331,8 +331,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Create Canvas",
|
||||
category: "Structural",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Create Canvas".to_string(),
|
||||
@@ -370,8 +370,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Draw Canvas",
|
||||
category: "Structural",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(2)],
|
||||
outputs: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
imports: vec![NodeId(0), NodeId(2)],
|
||||
exports: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Convert Image Frame".to_string(),
|
||||
@@ -429,8 +429,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Begin Scope",
|
||||
category: "Ignore",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "SetNode".to_string(),
|
||||
@@ -504,8 +504,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Output",
|
||||
category: "Ignore",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(3), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(4), 0)],
|
||||
imports: vec![NodeId(3), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(4), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "EditorApi".to_string(),
|
||||
@@ -566,8 +566,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Image Frame",
|
||||
category: "General",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Image Frame".to_string(),
|
||||
@@ -601,7 +601,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Noise Pattern",
|
||||
category: "General",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![
|
||||
imports: vec![
|
||||
NodeId(0),
|
||||
NodeId(0),
|
||||
NodeId(0),
|
||||
@@ -619,7 +619,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
NodeId(0),
|
||||
NodeId(0),
|
||||
],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Noise Pattern".to_string(),
|
||||
@@ -896,8 +896,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Split Channels",
|
||||
category: "Image Adjustments",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![
|
||||
NodeOutput::new(NodeId(1), 0),
|
||||
NodeOutput::new(NodeId(2), 0),
|
||||
NodeOutput::new(NodeId(3), 0),
|
||||
@@ -959,8 +959,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Brush",
|
||||
category: "Brush",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Brush".to_string(),
|
||||
@@ -1032,8 +1032,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Image",
|
||||
category: "Ignore",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Identity".to_string(),
|
||||
@@ -1065,8 +1065,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Uniform",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1117,8 +1117,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Storage",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1169,8 +1169,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "CreateOutputBuffer",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1227,8 +1227,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "CreateComputePass",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0), NodeId(1), NodeId(1)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0), NodeId(1), NodeId(1)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1329,8 +1329,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "ExecuteComputePipeline",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1381,8 +1381,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "ReadOutputBuffer",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1433,8 +1433,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "CreateGpuSurface",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Create Gpu Surface".to_string(),
|
||||
@@ -1472,8 +1472,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "RenderTexture",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(1), NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -1526,8 +1526,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "UploadTexture",
|
||||
category: "Gpu",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Extract Executor".to_string(),
|
||||
@@ -2161,8 +2161,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Circle",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Circle Generator".to_string(),
|
||||
@@ -2193,8 +2193,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Ellipse",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Ellipse Generator".to_string(),
|
||||
@@ -2229,8 +2229,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Rectangle",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Rectangle Generator".to_string(),
|
||||
@@ -2265,8 +2265,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Regular Polygon",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Regular Polygon Generator".to_string(),
|
||||
@@ -2301,8 +2301,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Star",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Star Generator".to_string(),
|
||||
@@ -2343,8 +2343,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Line",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Line Generator".to_string(),
|
||||
@@ -2379,8 +2379,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Spline",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Spline Generator".to_string(),
|
||||
@@ -2414,8 +2414,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Shape",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Path Generator".to_string(),
|
||||
@@ -2478,8 +2478,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Text",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0), NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
DocumentNode {
|
||||
name: "Text Generator".to_string(),
|
||||
@@ -2520,8 +2520,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Transform",
|
||||
category: "Transform",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(1), NodeId(1), NodeId(1), NodeId(1), NodeId(1)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(1), NodeId(1), NodeId(1), NodeId(1), NodeId(1)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
inputs: vec![NodeInput::Network(concrete!(VectorData))],
|
||||
@@ -2666,8 +2666,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "Sample Points",
|
||||
category: "Vector",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(2), NodeId(2), NodeId(2), NodeId(2)], // First is given to Identity, the rest are given to Sample Points
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)], // Taken from output 0 of Sample Points
|
||||
imports: vec![NodeId(0), NodeId(2), NodeId(2), NodeId(2), NodeId(2)], // First is given to Identity, the rest are given to Sample Points
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)], // Taken from output 0 of Sample Points
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Identity".to_string(),
|
||||
@@ -2820,7 +2820,7 @@ pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentN
|
||||
name: "Imaginate",
|
||||
category: "Image Synthesis",
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![
|
||||
imports: vec![
|
||||
NodeId(0),
|
||||
NodeId(1),
|
||||
NodeId(1),
|
||||
@@ -2839,7 +2839,7 @@ pub static IMAGINATE_NODE: Lazy<DocumentNodeDefinition> = Lazy::new(|| DocumentN
|
||||
NodeId(1),
|
||||
NodeId(1),
|
||||
],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(0),
|
||||
@@ -2973,7 +2973,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, hash: u64) -> NodeNetwork
|
||||
}
|
||||
}
|
||||
let len = network_inputs.len();
|
||||
network.inputs = network_inputs;
|
||||
network.imports = network_inputs;
|
||||
|
||||
// if the network has no inputs, it doesn't need to be wrapped in a scope
|
||||
if len == 0 {
|
||||
@@ -3007,8 +3007,8 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, hash: u64) -> NodeNetwork
|
||||
];
|
||||
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: nodes.into_iter().enumerate().map(|(id, node)| (NodeId(id as u64), node)).collect(),
|
||||
..Default::default()
|
||||
}
|
||||
@@ -3016,7 +3016,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, hash: u64) -> NodeNetwork
|
||||
|
||||
pub fn new_image_network(output_offset: i32, output_node_id: NodeId) -> NodeNetwork {
|
||||
let mut network = NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
imports: vec![NodeId(0)],
|
||||
..Default::default()
|
||||
};
|
||||
network.push_node(
|
||||
@@ -3040,7 +3040,7 @@ pub fn new_text_network(text: String, font: Font, size: f64) -> NodeNetwork {
|
||||
let output = resolve_document_node_type("Output").expect("Output node does not exist");
|
||||
|
||||
let mut network = NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
imports: vec![NodeId(0)],
|
||||
..Default::default()
|
||||
};
|
||||
network.push_node(text_generator.to_document_node(
|
||||
|
||||
+1
-1
@@ -1825,7 +1825,7 @@ pub fn imaginate_properties(document_node: &DocumentNode, node_id: NodeId, conte
|
||||
.introspect_node_in_network(
|
||||
context.network,
|
||||
&imaginate_node,
|
||||
|network| network.inputs.first().copied(),
|
||||
|network| network.imports.first().copied(),
|
||||
|frame: &IORecord<(), ImageFrame<Color>>| (frame.output.image.width, frame.output.image.height),
|
||||
)
|
||||
.unwrap_or_default();
|
||||
|
||||
@@ -141,7 +141,7 @@ impl DocumentMetadata {
|
||||
self.folders = HashSet::new();
|
||||
self.artboards = HashSet::new();
|
||||
|
||||
let id = graph.outputs[0].node_id;
|
||||
let id = graph.exports[0].node_id;
|
||||
let Some(output_node) = graph.nodes.get(&id) else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ impl NodeRuntime {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// We assume only one output
|
||||
assert_eq!(scoped_network.outputs.len(), 1, "Graph with multiple outputs not yet handled");
|
||||
assert_eq!(scoped_network.exports.len(), 1, "Graph with multiple outputs not yet handled");
|
||||
let c = Compiler {};
|
||||
let proto_network = match c.compile_single(scoped_network) {
|
||||
Ok(network) => network,
|
||||
|
||||
@@ -37,8 +37,8 @@ fn main() {
|
||||
|
||||
fn add_network() -> NodeNetwork {
|
||||
NodeNetwork {
|
||||
inputs: vec![],
|
||||
outputs: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
imports: vec![],
|
||||
exports: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
disabled: vec![],
|
||||
previous_outputs: None,
|
||||
nodes: [DocumentNode {
|
||||
|
||||
@@ -514,24 +514,26 @@ impl NodeOutput {
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
/// A network (subgraph) of nodes containing each [`DocumentNode`] and its ID, as well as a list of input nodes and [`NodeOutput`]s
|
||||
pub struct NodeNetwork {
|
||||
/// The list of nodes that are imported into this network from the parent network. Each is a reference to the node that the input is connected to.
|
||||
/// Presently, only one is supported— use an Identity node to split an input to multiple user nodes (although this could be changed in the future).
|
||||
pub inputs: Vec<NodeId>,
|
||||
/// The list of data outputs that are exported from this network to the parent network. Each is a reference to the node, and its output index, that is the source of the output data.
|
||||
pub outputs: Vec<NodeOutput>,
|
||||
/// The list of nodes that are imported into this network from the parent network.
|
||||
/// Each import is a reference to which node within this network that the input is connected to.
|
||||
/// Presently, only one is supported— use an Identity node to split an input to multiple user nodes (although this could, and should, be changed in the future).
|
||||
pub imports: Vec<NodeId>,
|
||||
/// The list of data outputs that are exported from this network to the parent network.
|
||||
/// Each export is a reference to a node within this network, paired with its output index, that is the source of the network's exported data.
|
||||
pub exports: Vec<NodeOutput>,
|
||||
/// The list of all nodes in this network.
|
||||
pub nodes: HashMap<NodeId, DocumentNode>,
|
||||
/// Nodes that the user has disabled/hidden with the visibility eye icon.
|
||||
/// These nodes get replaced with Identity nodes during the graph flattening step.
|
||||
pub disabled: Vec<NodeId>,
|
||||
/// In the case when another node is previewed (chosen by the user as a temporary output), this stores what it used to be so it can be restored later.
|
||||
/// In the case when another node is previewed (chosen by the user as a temporary output), this stores what it previously was so it can be restored later.
|
||||
pub previous_outputs: Option<Vec<NodeOutput>>,
|
||||
}
|
||||
|
||||
impl std::hash::Hash for NodeNetwork {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.inputs.hash(state);
|
||||
self.outputs.hash(state);
|
||||
self.imports.hash(state);
|
||||
self.exports.hash(state);
|
||||
let mut nodes: Vec<_> = self.nodes.iter().collect();
|
||||
nodes.sort_by_key(|(id, _)| *id);
|
||||
for (id, node) in nodes {
|
||||
@@ -553,17 +555,17 @@ impl NodeNetwork {
|
||||
|
||||
/// Get the original output nodes of this network, ignoring any preview node
|
||||
pub fn original_outputs(&self) -> &Vec<NodeOutput> {
|
||||
self.previous_outputs.as_ref().unwrap_or(&self.outputs)
|
||||
self.previous_outputs.as_ref().unwrap_or(&self.exports)
|
||||
}
|
||||
|
||||
pub fn input_types(&self) -> impl Iterator<Item = Type> + '_ {
|
||||
self.inputs.iter().map(move |id| self.nodes[id].inputs.get(0).map(|i| i.ty()).unwrap_or(concrete!(())))
|
||||
self.imports.iter().map(move |id| self.nodes[id].inputs.get(0).map(|i| i.ty()).unwrap_or(concrete!(())))
|
||||
}
|
||||
|
||||
pub fn value_network(node: DocumentNode) -> Self {
|
||||
Self {
|
||||
inputs: node.inputs.iter().filter(|input| matches!(input, NodeInput::Network(_))).map(|_| NodeId(0)).collect(),
|
||||
outputs: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
imports: node.inputs.iter().filter(|input| matches!(input, NodeInput::Network(_))).map(|_| NodeId(0)).collect(),
|
||||
exports: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
nodes: [(NodeId(0), node)].into_iter().collect(),
|
||||
disabled: vec![],
|
||||
previous_outputs: None,
|
||||
@@ -573,8 +575,8 @@ impl NodeNetwork {
|
||||
/// A graph with just an input node
|
||||
pub fn new_network() -> Self {
|
||||
Self {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
nodes: [(
|
||||
NodeId(0),
|
||||
DocumentNode {
|
||||
@@ -600,8 +602,8 @@ impl NodeNetwork {
|
||||
node.metadata.position = pos + IVec2::new(8, 0);
|
||||
}
|
||||
}
|
||||
if !self.outputs.is_empty() {
|
||||
let input = NodeInput::node(self.outputs[0].node_id, self.outputs[0].node_output_index);
|
||||
if !self.exports.is_empty() {
|
||||
let input = NodeInput::node(self.exports[0].node_id, self.exports[0].node_output_index);
|
||||
if node.inputs.is_empty() {
|
||||
node.inputs.push(input);
|
||||
} else {
|
||||
@@ -609,7 +611,7 @@ impl NodeNetwork {
|
||||
}
|
||||
}
|
||||
self.nodes.insert(id, node);
|
||||
self.outputs = vec![NodeOutput::new(id, 0)];
|
||||
self.exports = vec![NodeOutput::new(id, 0)];
|
||||
id
|
||||
}
|
||||
|
||||
@@ -630,8 +632,8 @@ impl NodeNetwork {
|
||||
name: "Cache".into(),
|
||||
inputs: vec![],
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: vec![
|
||||
(
|
||||
NodeId(0),
|
||||
@@ -686,13 +688,13 @@ impl NodeNetwork {
|
||||
/// Check if the specified node id is connected to the output
|
||||
pub fn connected_to_output(&self, target_node_id: NodeId) -> bool {
|
||||
// If the node is the output then return true
|
||||
if self.outputs.iter().any(|&NodeOutput { node_id, .. }| node_id == target_node_id) {
|
||||
if self.exports.iter().any(|&NodeOutput { node_id, .. }| node_id == target_node_id) {
|
||||
return true;
|
||||
}
|
||||
// Get the outputs
|
||||
let mut stack = self.outputs.iter().filter_map(|&output| self.nodes.get(&output.node_id)).collect::<Vec<_>>();
|
||||
let mut stack = self.exports.iter().filter_map(|&output| self.nodes.get(&output.node_id)).collect::<Vec<_>>();
|
||||
let mut already_visited = HashSet::new();
|
||||
already_visited.extend(self.outputs.iter().map(|output| output.node_id));
|
||||
already_visited.extend(self.exports.iter().map(|output| output.node_id));
|
||||
|
||||
while let Some(node) = stack.pop() {
|
||||
for input in &node.inputs {
|
||||
@@ -720,7 +722,7 @@ impl NodeNetwork {
|
||||
|
||||
/// Is the node being used directly as an output?
|
||||
pub fn outputs_contain(&self, node_id: NodeId) -> bool {
|
||||
self.outputs.iter().any(|output| output.node_id == node_id)
|
||||
self.exports.iter().any(|output| output.node_id == node_id)
|
||||
}
|
||||
|
||||
/// Is the node being used directly as an original output?
|
||||
@@ -774,8 +776,8 @@ impl NodeNetwork {
|
||||
|
||||
pub fn output_as_input(&self, arg: usize) -> NodeInput {
|
||||
NodeInput::Node {
|
||||
node_id: self.outputs[arg].node_id,
|
||||
output_index: self.outputs[arg].node_output_index,
|
||||
node_id: self.exports[arg].node_id,
|
||||
output_index: self.exports[arg].node_output_index,
|
||||
lambda: false,
|
||||
}
|
||||
}
|
||||
@@ -811,8 +813,8 @@ impl<'a> Iterator for FlowIter<'a> {
|
||||
impl NodeNetwork {
|
||||
/// Replace all references in the graph of a node ID with a new node ID defined by the function `f`.
|
||||
pub fn map_ids(&mut self, f: impl Fn(NodeId) -> NodeId + Copy) {
|
||||
self.inputs.iter_mut().for_each(|id| *id = f(*id));
|
||||
self.outputs.iter_mut().for_each(|output| output.node_id = f(output.node_id));
|
||||
self.imports.iter_mut().for_each(|id| *id = f(*id));
|
||||
self.exports.iter_mut().for_each(|output| output.node_id = f(output.node_id));
|
||||
self.disabled.iter_mut().for_each(|id| *id = f(*id));
|
||||
self.previous_outputs
|
||||
.iter_mut()
|
||||
@@ -875,7 +877,7 @@ impl NodeNetwork {
|
||||
|
||||
/// Replace all references in any node of `old_output` with `new_output`
|
||||
fn replace_network_outputs(&mut self, old_output: NodeOutput, new_output: NodeOutput) {
|
||||
for output in self.outputs.iter_mut() {
|
||||
for output in self.exports.iter_mut() {
|
||||
if *output == old_output {
|
||||
*output = new_output;
|
||||
}
|
||||
@@ -886,7 +888,7 @@ impl NodeNetwork {
|
||||
pub fn remove_dead_nodes(&mut self) -> Vec<bool> {
|
||||
// Take all the nodes out of the nodes list
|
||||
let mut old_nodes = std::mem::take(&mut self.nodes);
|
||||
let mut stack = self.outputs.iter().map(|output| output.node_id).collect::<Vec<_>>();
|
||||
let mut stack = self.exports.iter().map(|output| output.node_id).collect::<Vec<_>>();
|
||||
while let Some(node_id) = stack.pop() {
|
||||
let Some((node_id, mut document_node)) = old_nodes.remove_entry(&node_id) else {
|
||||
continue;
|
||||
@@ -909,9 +911,9 @@ impl NodeNetwork {
|
||||
}
|
||||
|
||||
// Check if inputs are used and store for return value
|
||||
let are_inputs_used = self.inputs.iter().map(|input| self.nodes.contains_key(input)).collect();
|
||||
let are_inputs_used = self.imports.iter().map(|input| self.nodes.contains_key(input)).collect();
|
||||
// Remove unused inputs from graph
|
||||
self.inputs.retain(|input| self.nodes.contains_key(input));
|
||||
self.imports.retain(|input| self.nodes.contains_key(input));
|
||||
|
||||
are_inputs_used
|
||||
}
|
||||
@@ -986,21 +988,21 @@ impl NodeNetwork {
|
||||
let mut network_offsets = HashMap::new();
|
||||
assert_eq!(
|
||||
node.inputs.len(),
|
||||
inner_network.inputs.len(),
|
||||
inner_network.imports.len(),
|
||||
"\n\nThe number of inputs to the node and the inner network must be the same for \"{}\". The node has {} inputs, the network has {} inputs.\n\nNode inputs:\n\n{:?}\n\nNetwork inputs:\n\n{:?}\n",
|
||||
node.name,
|
||||
node.inputs.len(),
|
||||
inner_network.inputs.len(),
|
||||
inner_network.imports.len(),
|
||||
node.inputs,
|
||||
inner_network.inputs
|
||||
inner_network.imports
|
||||
);
|
||||
assert_eq!(
|
||||
node.inputs.len(),
|
||||
inner_network.inputs.len(),
|
||||
inner_network.imports.len(),
|
||||
"Document Nodes with a Network implementation should have the same number of inner network inputs as inputs declared on the Document Node"
|
||||
);
|
||||
// Match the document node input and the inputs of the inner network
|
||||
for (input_index, (document_input, network_input)) in node.inputs.into_iter().zip(inner_network.inputs.iter()).enumerate() {
|
||||
for (input_index, (document_input, network_input)) in node.inputs.into_iter().zip(inner_network.imports.iter()).enumerate() {
|
||||
// Keep track of how many network inputs we have already connected for each node
|
||||
let offset = network_offsets.entry(network_input).or_insert(0);
|
||||
match document_input {
|
||||
@@ -1012,8 +1014,8 @@ impl NodeNetwork {
|
||||
}
|
||||
NodeInput::Network(_) => {
|
||||
*network_offsets.get_mut(network_input).unwrap() += 1;
|
||||
if let Some(index) = self.inputs.iter().position(|i| *i == id) {
|
||||
self.inputs[index] = *network_input;
|
||||
if let Some(index) = self.imports.iter().position(|i| *i == id) {
|
||||
self.imports[index] = *network_input;
|
||||
}
|
||||
}
|
||||
NodeInput::Value { .. } => unreachable!("Value inputs should have been replaced with value nodes"),
|
||||
@@ -1022,7 +1024,7 @@ impl NodeNetwork {
|
||||
}
|
||||
|
||||
// Connect all nodes that were previously connected to this node to the nodes of the inner network
|
||||
for (i, output) in inner_network.outputs.into_iter().enumerate() {
|
||||
for (i, output) in inner_network.exports.into_iter().enumerate() {
|
||||
let node_input = |node_id, output_index, lambda| NodeInput::Node { node_id, output_index, lambda };
|
||||
|
||||
self.replace_node_inputs(node_input(id, i, false), node_input(output.node_id, output.node_output_index, false));
|
||||
@@ -1082,7 +1084,7 @@ impl NodeNetwork {
|
||||
for NodeOutput {
|
||||
ref mut node_id,
|
||||
ref mut node_output_index,
|
||||
} in self.outputs.iter_mut()
|
||||
} in self.exports.iter_mut()
|
||||
{
|
||||
if *node_id == id {
|
||||
*node_id = input_node_id;
|
||||
@@ -1199,8 +1201,8 @@ impl NodeNetwork {
|
||||
nodes.sort_unstable_by_key(|(i, _)| *i);
|
||||
|
||||
// Create a network to evaluate each output
|
||||
self.outputs.into_iter().map(move |output| ProtoNetwork {
|
||||
inputs: self.inputs.clone(),
|
||||
self.exports.into_iter().map(move |output| ProtoNetwork {
|
||||
inputs: self.imports.clone(),
|
||||
output: output.node_id,
|
||||
nodes: nodes.clone(),
|
||||
})
|
||||
@@ -1244,8 +1246,8 @@ mod test {
|
||||
|
||||
fn add_network() -> NodeNetwork {
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(0),
|
||||
@@ -1277,8 +1279,8 @@ mod test {
|
||||
let mut network = add_network();
|
||||
network.map_ids(|id| NodeId(id.0 + 1));
|
||||
let mapped_add = NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(1)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(1)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(1),
|
||||
@@ -1316,8 +1318,8 @@ mod test {
|
||||
};
|
||||
// TODO: Extend test cases to test nested network
|
||||
let mut extraction_network = NodeNetwork {
|
||||
inputs: vec![],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
id_node.clone(),
|
||||
DocumentNode {
|
||||
@@ -1343,8 +1345,8 @@ mod test {
|
||||
#[test]
|
||||
fn flatten_add() {
|
||||
let mut network = NodeNetwork {
|
||||
inputs: vec![NodeId(1)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(1)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [(
|
||||
NodeId(1),
|
||||
DocumentNode {
|
||||
@@ -1446,8 +1448,8 @@ mod test {
|
||||
|
||||
fn flat_network() -> NodeNetwork {
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(10)],
|
||||
outputs: vec![NodeOutput::new(NodeId(11), 0)],
|
||||
imports: vec![NodeId(10)],
|
||||
exports: vec![NodeOutput::new(NodeId(11), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(10),
|
||||
@@ -1509,8 +1511,8 @@ mod test {
|
||||
|
||||
fn two_node_identity() -> NodeNetwork {
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(1), NodeId(2)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(1), NodeId(2)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(1),
|
||||
@@ -1539,8 +1541,8 @@ mod test {
|
||||
|
||||
fn output_duplicate(network_outputs: Vec<NodeOutput>, result_node_input: NodeInput) -> NodeNetwork {
|
||||
let mut network = NodeNetwork {
|
||||
inputs: Vec::new(),
|
||||
outputs: network_outputs,
|
||||
imports: Vec::new(),
|
||||
exports: network_outputs,
|
||||
nodes: [
|
||||
(
|
||||
NodeId(1),
|
||||
@@ -1576,8 +1578,8 @@ mod test {
|
||||
fn simple_duplicate() {
|
||||
let result = output_duplicate(vec![NodeOutput::new(NodeId(1), 0)], NodeInput::node(NodeId(1), 0));
|
||||
println!("{result:#?}");
|
||||
assert_eq!(result.outputs.len(), 1, "The number of outputs should remain as 1");
|
||||
assert_eq!(result.outputs[0], NodeOutput::new(NodeId(11), 0), "The outer network output should be from a duplicated inner network");
|
||||
assert_eq!(result.exports.len(), 1, "The number of outputs should remain as 1");
|
||||
assert_eq!(result.exports[0], NodeOutput::new(NodeId(11), 0), "The outer network output should be from a duplicated inner network");
|
||||
let mut ids = result.nodes.keys().copied().collect::<Vec<_>>();
|
||||
ids.sort();
|
||||
assert_eq!(ids, vec![NodeId(11), NodeId(10010)], "Should only contain identity and values");
|
||||
|
||||
@@ -30,7 +30,7 @@ impl Compiler {
|
||||
Ok(proto_networks_result.into_iter())
|
||||
}
|
||||
pub fn compile_single(&self, network: NodeNetwork) -> Result<ProtoNetwork, String> {
|
||||
assert_eq!(network.outputs.len(), 1, "Graph with multiple outputs not yet handled");
|
||||
assert_eq!(network.exports.len(), 1, "Graph with multiple outputs not yet handled");
|
||||
let Some(proto_network) = self.compile(network)?.next() else {
|
||||
return Err("Failed to convert graph into proto graph".to_string());
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork) -> NodeNetwork {
|
||||
}
|
||||
}
|
||||
let len = network_inputs.len();
|
||||
network.inputs = network_inputs;
|
||||
network.imports = network_inputs;
|
||||
|
||||
// if the network has no inputs, it doesn't need to be wrapped in a scope
|
||||
if len == 0 {
|
||||
@@ -140,8 +140,8 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork) -> NodeNetwork {
|
||||
},
|
||||
];
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: nodes.into_iter().enumerate().map(|(id, node)| (NodeId(id as u64), node)).collect(),
|
||||
..Default::default()
|
||||
}
|
||||
@@ -151,8 +151,8 @@ fn begin_scope() -> DocumentNode {
|
||||
DocumentNode {
|
||||
name: "Begin Scope".to_string(),
|
||||
implementation: DocumentNodeImplementation::Network(NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0), NodeOutput::new(NodeId(2), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "SetNode".to_string(),
|
||||
|
||||
@@ -169,11 +169,11 @@ async fn create_compute_pass_descriptor<T: Clone + Pixel + StaticTypeSized>(
|
||||
|
||||
log::debug!("inner_network: {inner_network:?}");
|
||||
let network = NodeNetwork {
|
||||
inputs: vec![NodeId(2), NodeId(1)], //vec![0, 1],
|
||||
imports: vec![NodeId(2), NodeId(1)], //vec![0, 1],
|
||||
#[cfg(feature = "quantization")]
|
||||
outputs: vec![NodeOutput::new(NodeId(5), 0)],
|
||||
exports: vec![NodeOutput::new(NodeId(5), 0)],
|
||||
#[cfg(not(feature = "quantization"))]
|
||||
outputs: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
exports: vec![NodeOutput::new(NodeId(3), 0)],
|
||||
nodes: [
|
||||
DocumentNode {
|
||||
name: "Slice".into(),
|
||||
@@ -434,8 +434,8 @@ async fn blend_gpu_image(foreground: ImageFrame<Color>, background: ImageFrame<C
|
||||
let compiler = graph_craft::graphene_compiler::Compiler {};
|
||||
|
||||
let network = NodeNetwork {
|
||||
inputs: vec![],
|
||||
outputs: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
imports: vec![],
|
||||
exports: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
nodes: [DocumentNode {
|
||||
name: "BlendOp".into(),
|
||||
inputs: vec![NodeInput::Inline(InlineRust::new(
|
||||
|
||||
@@ -16,8 +16,8 @@ mod tests {
|
||||
|
||||
fn add_network() -> NodeNetwork {
|
||||
NodeNetwork {
|
||||
inputs: vec![NodeId(0), NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0), NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
(
|
||||
NodeId(0),
|
||||
@@ -45,8 +45,8 @@ mod tests {
|
||||
}
|
||||
|
||||
let network = NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(0), 0)],
|
||||
nodes: [(
|
||||
NodeId(0),
|
||||
DocumentNode {
|
||||
@@ -86,8 +86,8 @@ mod tests {
|
||||
use graph_craft::*;
|
||||
|
||||
let network = NodeNetwork {
|
||||
inputs: vec![NodeId(0)],
|
||||
outputs: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
imports: vec![NodeId(0)],
|
||||
exports: vec![NodeOutput::new(NodeId(1), 0)],
|
||||
nodes: [
|
||||
// Simple identity node taking a number as input from outside the graph
|
||||
(
|
||||
|
||||
Reference in new issue
Block a user