Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a basic API and rudimentary frontend for node graph layers (#846)
* Node graph API stub * Rename and fix SetInputValue * Get list of links from network * Test populating node graph UI * Node properties * Fix viewport bounds * Slightly change promise usage * A tiny bit of cleanup I did while reading code * Cleanup and work towards hooking up node links in Vue template * Add the brighten colour node * Run cargo fmt * Add to and from hsla * GrayscaleImage node with small perf improvement * Fix gutter panel resizing * Display node links from backend * Add support for connecting node links * Use existing message * Fix formatting error * Add a (currently crashing) brighten node * Replace brighten node with proto node implementation * Add support for connecting node links * Update watch dirs * Add hue shift node * Add create_node function to editor api * Basic insert node UI * Fix broken names * Add log * Fix positioning * Set connector index to 0 * Add properties for Heu shift / brighten * Allow deselecting nodes * Redesign Properties panel collapsible sections Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: Dennis Kobert <dennis@kobert.dev>
- Loading branch information
1 parent
d75f0aa
commit d9177f5
Showing
37 changed files
with
1,212 additions
and
293 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mod node_graph_message; | ||
mod node_graph_message_handler; | ||
|
||
#[doc(inline)] | ||
pub use node_graph_message::{NodeGraphMessage, NodeGraphMessageDiscriminant}; | ||
#[doc(inline)] | ||
pub use node_graph_message_handler::*; |
44 changes: 44 additions & 0 deletions
44
editor/src/messages/portfolio/document/node_graph/node_graph_message.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use crate::messages::prelude::*; | ||
use graph_craft::document::{value::TaggedValue, NodeId}; | ||
use graph_craft::proto::NodeIdentifier; | ||
|
||
#[remain::sorted] | ||
#[impl_message(Message, DocumentMessage, NodeGraph)] | ||
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)] | ||
pub enum NodeGraphMessage { | ||
// Messages | ||
AddLink { | ||
from: NodeId, | ||
to: NodeId, | ||
to_index: usize, | ||
}, | ||
CloseNodeGraph, | ||
ConnectNodesByLink { | ||
output_node: u64, | ||
input_node: u64, | ||
input_node_connector_index: u32, | ||
}, | ||
CreateNode { | ||
// Having the caller generate the id means that we don't have to return it. This can be a random u64. | ||
node_id: NodeId, | ||
// I don't really know what this is for (perhaps a user identifiable name). | ||
name: String, | ||
// The node identifier must mach that found in `node-graph/graph-craft/src/node_registry.rs` e.g. "graphene_core::raster::GrayscaleNode | ||
identifier: NodeIdentifier, | ||
num_inputs: u32, | ||
}, | ||
DeleteNode { | ||
node_id: NodeId, | ||
}, | ||
OpenNodeGraph { | ||
layer_path: Vec<graphene::LayerId>, | ||
}, | ||
SelectNodes { | ||
nodes: Vec<NodeId>, | ||
}, | ||
SetInputValue { | ||
node: NodeId, | ||
input_index: usize, | ||
value: TaggedValue, | ||
}, | ||
} |
Oops, something went wrong.