Add upgrade script to convert "Spline" node to "Path" -> "Spline from Points" (#2274)

* write document upgrade code to transfrom Spline node into Path -> Spline from Points

* fix only connecting to single output

* shift position of newly inserted Path -> Spline from Points node

* refactor

* remove all old Spline node code

* rename Spline from Points node to Spline

* Code cleanup

* Update the demo art to natively use the new Spline node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Priyanshu
2025-02-12 23:45:30 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 95bbc95606
commit 2d90bb0cbf
7 changed files with 87 additions and 40 deletions
@@ -2012,29 +2012,6 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
description: Cow::Borrowed("TODO"),
properties: None,
},
DocumentNodeDefinition {
identifier: "Spline",
category: "Vector: Shape",
node_template: NodeTemplate {
document_node: DocumentNode {
implementation: DocumentNodeImplementation::proto("graphene_core::vector::generator_nodes::SplineNode"),
manual_composition: Some(concrete!(())),
inputs: vec![
NodeInput::value(TaggedValue::None, false),
// TODO: Modify the proto node generation macro to accept this default value, then remove this definition for Spline
NodeInput::value(TaggedValue::VecDVec2(vec![DVec2::new(0., -50.), DVec2::new(25., 0.), DVec2::new(0., 50.)]), false),
],
..Default::default()
},
persistent_node_metadata: DocumentNodePersistentMetadata {
input_properties: vec!["None".into(), PropertiesRow::with_override("Points", WidgetOverride::Custom("spline_input".to_string()))],
output_names: vec!["Vector".to_string()],
..Default::default()
},
},
description: Cow::Borrowed("TODO"),
properties: None,
},
DocumentNodeDefinition {
identifier: "Path",
category: "Vector",