Skip to content

Commit 80e21bf

Browse files
committed
Revert changes to layer nodes
1 parent 70931b1 commit 80e21bf

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,25 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
237237
node_template: NodeTemplate {
238238
document_node: DocumentNode {
239239
implementation: DocumentNodeImplementation::Network(NodeNetwork {
240-
exports: vec![NodeInput::node(NodeId(1), 0)],
240+
exports: vec![NodeInput::node(NodeId(3), 0)],
241241
nodes: [
242+
// Secondary (left) input type coercion
243+
DocumentNode {
244+
inputs: vec![NodeInput::network(generic!(T), 1)],
245+
implementation: DocumentNodeImplementation::proto("graphene_core::graphic_element::ToElementNode"),
246+
manual_composition: Some(concrete!(Context)),
247+
..Default::default()
248+
},
249+
// Primary (bottom) input type coercion
250+
DocumentNode {
251+
inputs: vec![NodeInput::network(generic!(T), 0)],
252+
implementation: DocumentNodeImplementation::proto("graphene_core::graphic_element::ToGroupNode"),
253+
manual_composition: Some(concrete!(Context)),
254+
..Default::default()
255+
},
242256
// The monitor node is used to display a thumbnail in the UI
243257
DocumentNode {
244-
inputs: vec![NodeInput::network(concrete!(GraphicElement), 1)],
258+
inputs: vec![NodeInput::node(NodeId(0), 0)],
245259
implementation: DocumentNodeImplementation::proto("graphene_core::memo::MonitorNode"),
246260
manual_composition: Some(concrete!(Context)),
247261
skip_deduplication: true,
@@ -250,8 +264,8 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
250264
DocumentNode {
251265
manual_composition: Some(generic!(T)),
252266
inputs: vec![
253-
NodeInput::network(concrete!(GraphicGroupTable), 0),
254-
NodeInput::node(NodeId(0), 0),
267+
NodeInput::node(NodeId(1), 0),
268+
NodeInput::node(NodeId(2), 0),
255269
NodeInput::Reflection(graph_craft::document::DocumentNodeMetadata::DocumentNodePath),
256270
],
257271
implementation: DocumentNodeImplementation::proto("graphene_core::graphic_element::LayerNode"),

node-graph/interpreted-executor/src/node_registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, HashMap<NodeIOTypes, NodeCons
3232
into_node!(from: RasterDataTable<CPU>, to: RasterDataTable<CPU>),
3333
// into_node!(from: RasterDataTable<CPU>, to: RasterDataTable<SRGBA8>),
3434
into_node!(from: RasterDataTable<CPU>, to: GraphicElement),
35+
into_node!(from: RasterDataTable<GPU>, to: GraphicElement),
3536
into_node!(from: RasterDataTable<CPU>, to: GraphicGroupTable),
3637
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => RasterDataTable<CPU>]),
3738
async_node!(graphene_core::memo::MonitorNode<_, _, _>, input: Context, fn_params: [Context => ImageTexture]),

node-graph/preprocessor/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use graphene_std::*;
88
use std::collections::{HashMap, HashSet};
99

1010
pub fn expand_network(network: &mut NodeNetwork, substitutions: &HashMap<String, DocumentNode>) {
11+
if network.generated {
12+
return;
13+
}
1114
for node in network.nodes.values_mut() {
1215
match &mut node.implementation {
1316
DocumentNodeImplementation::Network(node_network) => expand_network(node_network, substitutions),

0 commit comments

Comments
 (0)