Skip to content

Commit 316a737

Browse files
committed
Remove 'To u32', 'To u64', and 'To f64' number conversion nodes and clean up node type usages
1 parent 532e913 commit 316a737

17 files changed

+182
-80
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/isometric-fountain.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/marbled-mandelbrot.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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,9 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
10161016
..Default::default()
10171017
},
10181018
},
1019-
description: Cow::Borrowed("TODO"),
1019+
description: Cow::Borrowed(
1020+
"Decomposes the X and Y components of a 2D coordinate.\n\nThe inverse of this node is \"Coordinate Value\", which can have either or both its X and Y exposed as graph inputs.",
1021+
),
10201022
properties: None,
10211023
},
10221024
// TODO: Remove this and just use the proto node definition directly

editor/src/messages/portfolio/document_migration.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,44 @@ pub fn document_migration_upgrades(document: &mut DocumentMessageHandler, reset_
722722

723723
document.network_interface.replace_reference_name(node_id, network_path, "Sample Polyline".to_string());
724724
}
725+
726+
// Replace "To u32" and "To u64" nodes with "Floor" nodes
727+
if reference == "To u32" || reference == "To u64" {
728+
let node_definition = resolve_document_node_type("Floor").unwrap();
729+
let new_node_template = node_definition.default_node_template();
730+
let document_node = new_node_template.document_node;
731+
document.network_interface.replace_implementation(node_id, network_path, document_node.implementation.clone());
732+
document
733+
.network_interface
734+
.replace_implementation_metadata(node_id, network_path, new_node_template.persistent_node_metadata);
735+
736+
let old_inputs = document.network_interface.replace_inputs(node_id, document_node.inputs.clone(), network_path);
737+
738+
document.network_interface.set_input(&InputConnector::node(*node_id, 0), old_inputs[0].clone(), network_path);
739+
740+
document.network_interface.replace_reference_name(node_id, network_path, "Floor".to_string());
741+
document
742+
.network_interface
743+
.set_manual_compostion(node_id, network_path, graph_craft::concrete!(graphene_std::Context).into());
744+
}
745+
746+
// Replace the "To f64" node with the "Identity" node
747+
if reference == "To f64" {
748+
let node_definition = resolve_document_node_type("Identity").unwrap();
749+
let new_node_template = node_definition.default_node_template();
750+
let document_node = new_node_template.document_node;
751+
document.network_interface.replace_implementation(node_id, network_path, document_node.implementation.clone());
752+
document
753+
.network_interface
754+
.replace_implementation_metadata(node_id, network_path, new_node_template.persistent_node_metadata);
755+
756+
let old_inputs = document.network_interface.replace_inputs(node_id, document_node.inputs.clone(), network_path);
757+
758+
document.network_interface.set_input(&InputConnector::node(*node_id, 0), old_inputs[0].clone(), network_path);
759+
760+
document.network_interface.replace_reference_name(node_id, network_path, "Identity".to_string());
761+
document.network_interface.set_manual_compostion(node_id, network_path, None);
762+
}
725763
}
726764

727765
// Ensure layers are positioned as stacks if they are upstream siblings of another layer

0 commit comments

Comments
 (0)