Skip to content

Commit 6cd0dbd

Browse files
0HyperCubeKeavon
andauthored
Node graph improvements (#855)
* Selecting multiple nodes * Improve logs * Log bad types in dyn any * Add (broken) node links * New topological sort * Fix reorder ids function * Input and output node * Add nodes that operate on images * Fixups * Show node parameters together with layer properties * New nodes don't crash editor * Fix tests * Node positions backend * Generate node graph on value change * Add expose input message * Fix tests Co-authored-by: Keavon Chambers <[email protected]>
1 parent 5fe7aba commit 6cd0dbd

File tree

23 files changed

+736
-333
lines changed

23 files changed

+736
-333
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/src/messages/portfolio/document/node_graph/node_graph_message.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
use crate::messages::prelude::*;
22
use graph_craft::document::{value::TaggedValue, NodeId};
3-
use graph_craft::proto::NodeIdentifier;
43

54
#[remain::sorted]
65
#[impl_message(Message, DocumentMessage, NodeGraph)]
76
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
87
pub enum NodeGraphMessage {
98
// Messages
10-
AddLink {
11-
from: NodeId,
12-
to: NodeId,
13-
to_index: usize,
14-
},
159
CloseNodeGraph,
1610
ConnectNodesByLink {
1711
output_node: u64,
1812
input_node: u64,
19-
input_node_connector_index: u32,
13+
input_node_connector_index: usize,
2014
},
2115
CreateNode {
2216
// Having the caller generate the id means that we don't have to return it. This can be a random u64.
2317
node_id: NodeId,
2418
// I don't really know what this is for (perhaps a user identifiable name).
25-
name: String,
26-
// The node identifier must mach that found in `node-graph/graph-craft/src/node_registry.rs` e.g. "graphene_core::raster::GrayscaleNode
27-
identifier: NodeIdentifier,
28-
num_inputs: u32,
19+
node_type: String,
2920
},
3021
DeleteNode {
3122
node_id: NodeId,
3223
},
24+
ExposeInput {
25+
node_id: NodeId,
26+
input_index: usize,
27+
new_exposed: bool,
28+
},
29+
MoveSelectedNodes {
30+
displacement_x: i32,
31+
displacement_y: i32,
32+
},
3333
OpenNodeGraph {
3434
layer_path: Vec<graphene::LayerId>,
3535
},

0 commit comments

Comments
 (0)