Skip to content

Commit 184c009

Browse files
committed
Add memoization to instancer nodes
1 parent ee6a842 commit 184c009

File tree

7 files changed

+60
-18
lines changed

7 files changed

+60
-18
lines changed

demo-artwork/changing-seasons.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/painted-dreams.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/parametric-dunescape.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/procedural-string-lights.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/red-dress.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/valley-of-spires.graphite

Lines changed: 1 addition & 1 deletion
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/document_node_definitions.rs

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
21782178
node_template: NodeTemplate {
21792179
document_node: DocumentNode {
21802180
implementation: DocumentNodeImplementation::Network(NodeNetwork {
2181-
exports: vec![NodeInput::node(NodeId(2), 0)],
2181+
exports: vec![NodeInput::node(NodeId(3), 0)],
21822182
nodes: vec![
21832183
DocumentNode {
21842184
inputs: vec![NodeInput::network(concrete!(VectorDataTable), 0), NodeInput::network(concrete!(vector::style::Fill), 1)],
@@ -2188,12 +2188,18 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
21882188
},
21892189
DocumentNode {
21902190
inputs: vec![NodeInput::node(NodeId(0), 0)],
2191-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2191+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::MemoNode")),
21922192
manual_composition: Some(generic!(T)),
21932193
..Default::default()
21942194
},
21952195
DocumentNode {
21962196
inputs: vec![NodeInput::node(NodeId(1), 0)],
2197+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2198+
manual_composition: Some(generic!(T)),
2199+
..Default::default()
2200+
},
2201+
DocumentNode {
2202+
inputs: vec![NodeInput::node(NodeId(2), 0)],
21972203
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::BoundlessFootprintNode")),
21982204
manual_composition: Some(generic!(T)),
21992205
..Default::default()
@@ -2225,20 +2231,28 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
22252231
},
22262232
DocumentNodeMetadata {
22272233
persistent_metadata: DocumentNodePersistentMetadata {
2228-
display_name: "Freeze Real Time".to_string(),
2234+
display_name: "Memoize".to_string(),
22292235
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
22302236
..Default::default()
22312237
},
22322238
..Default::default()
22332239
},
22342240
DocumentNodeMetadata {
22352241
persistent_metadata: DocumentNodePersistentMetadata {
2236-
display_name: "Boundless Footprint".to_string(),
2242+
display_name: "Freeze Real Time".to_string(),
22372243
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(14, 0)),
22382244
..Default::default()
22392245
},
22402246
..Default::default()
22412247
},
2248+
DocumentNodeMetadata {
2249+
persistent_metadata: DocumentNodePersistentMetadata {
2250+
display_name: "Boundless Footprint".to_string(),
2251+
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(21, 0)),
2252+
..Default::default()
2253+
},
2254+
..Default::default()
2255+
},
22422256
]
22432257
.into_iter()
22442258
.enumerate()
@@ -2359,7 +2373,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
23592373
node_template: NodeTemplate {
23602374
document_node: DocumentNode {
23612375
implementation: DocumentNodeImplementation::Network(NodeNetwork {
2362-
exports: vec![NodeInput::node(NodeId(3), 0)], // Taken from output 0 of Sample Points
2376+
exports: vec![NodeInput::node(NodeId(4), 0)], // Taken from output 0 of Sample Points
23632377
nodes: [
23642378
DocumentNode {
23652379
inputs: vec![NodeInput::network(concrete!(graphene_core::vector::VectorDataTable), 0)],
@@ -2382,12 +2396,18 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
23822396
},
23832397
DocumentNode {
23842398
inputs: vec![NodeInput::node(NodeId(1), 0)],
2385-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2399+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::MemoNode")),
23862400
manual_composition: Some(generic!(T)),
23872401
..Default::default()
23882402
},
23892403
DocumentNode {
23902404
inputs: vec![NodeInput::node(NodeId(2), 0)],
2405+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2406+
manual_composition: Some(generic!(T)),
2407+
..Default::default()
2408+
},
2409+
DocumentNode {
2410+
inputs: vec![NodeInput::node(NodeId(3), 0)],
23912411
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::BoundlessFootprintNode")),
23922412
manual_composition: Some(generic!(T)),
23932413
..Default::default()
@@ -2430,20 +2450,28 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
24302450
},
24312451
DocumentNodeMetadata {
24322452
persistent_metadata: DocumentNodePersistentMetadata {
2433-
display_name: "Freeze Real Time".to_string(),
2453+
display_name: "Memoize".to_string(),
24342454
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(14, 0)),
24352455
..Default::default()
24362456
},
24372457
..Default::default()
24382458
},
24392459
DocumentNodeMetadata {
24402460
persistent_metadata: DocumentNodePersistentMetadata {
2441-
display_name: "Boundless Footprint".to_string(),
2461+
display_name: "Freeze Real Time".to_string(),
24422462
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(21, 0)),
24432463
..Default::default()
24442464
},
24452465
..Default::default()
24462466
},
2467+
DocumentNodeMetadata {
2468+
persistent_metadata: DocumentNodePersistentMetadata {
2469+
display_name: "Boundless Footprint".to_string(),
2470+
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(28, 0)),
2471+
..Default::default()
2472+
},
2473+
..Default::default()
2474+
},
24472475
]
24482476
.into_iter()
24492477
.enumerate()
@@ -2498,7 +2526,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
24982526
node_template: NodeTemplate {
24992527
document_node: DocumentNode {
25002528
implementation: DocumentNodeImplementation::Network(NodeNetwork {
2501-
exports: vec![NodeInput::node(NodeId(2), 0)],
2529+
exports: vec![NodeInput::node(NodeId(3), 0)],
25022530
nodes: [
25032531
DocumentNode {
25042532
inputs: vec![
@@ -2512,12 +2540,18 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
25122540
},
25132541
DocumentNode {
25142542
inputs: vec![NodeInput::node(NodeId(0), 0)],
2515-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2543+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::memo::MemoNode")),
25162544
manual_composition: Some(generic!(T)),
25172545
..Default::default()
25182546
},
25192547
DocumentNode {
25202548
inputs: vec![NodeInput::node(NodeId(1), 0)],
2549+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::FreezeRealTimeNode")),
2550+
manual_composition: Some(generic!(T)),
2551+
..Default::default()
2552+
},
2553+
DocumentNode {
2554+
inputs: vec![NodeInput::node(NodeId(2), 0)],
25212555
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::transform::BoundlessFootprintNode")),
25222556
manual_composition: Some(generic!(T)),
25232557
..Default::default()
@@ -2550,20 +2584,28 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
25502584
},
25512585
DocumentNodeMetadata {
25522586
persistent_metadata: DocumentNodePersistentMetadata {
2553-
display_name: "Freeze Real Time".to_string(),
2587+
display_name: "Memoize".to_string(),
25542588
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
25552589
..Default::default()
25562590
},
25572591
..Default::default()
25582592
},
25592593
DocumentNodeMetadata {
25602594
persistent_metadata: DocumentNodePersistentMetadata {
2561-
display_name: "Boundless Footprint".to_string(),
2595+
display_name: "Freeze Real Time".to_string(),
25622596
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(14, 0)),
25632597
..Default::default()
25642598
},
25652599
..Default::default()
25662600
},
2601+
DocumentNodeMetadata {
2602+
persistent_metadata: DocumentNodePersistentMetadata {
2603+
display_name: "Boundless Footprint".to_string(),
2604+
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(21, 0)),
2605+
..Default::default()
2606+
},
2607+
..Default::default()
2608+
},
25672609
]
25682610
.into_iter()
25692611
.enumerate()

0 commit comments

Comments
 (0)