Skip to content

Commit 0881757

Browse files
committed
Add "Loop Level" to the Position context reader node
1 parent a88342b commit 0881757

6 files changed

Lines changed: 270 additions & 126 deletions

File tree

editor/src/messages/portfolio/document_migration.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,20 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
16461646
.set_input(&InputConnector::node(*node_id, 1), NodeInput::value(TaggedValue::F64(1.), false), network_path);
16471647
}
16481648

1649+
// Upgrade the "Instance Position" node to add the "Loop Level" input
1650+
if reference == DefinitionIdentifier::ProtoNode(graphene_std::vector_nodes::instance::instance_position::IDENTIFIER) && inputs_count < 2 {
1651+
let mut node_template = resolve_document_node_type(&reference)?.default_node_template();
1652+
document.network_interface.replace_implementation(node_id, network_path, &mut node_template);
1653+
let _ = document.network_interface.replace_inputs(node_id, network_path, &mut node_template);
1654+
1655+
document
1656+
.network_interface
1657+
.set_input(&InputConnector::node(*node_id, 0), NodeInput::value(TaggedValue::None, false), network_path);
1658+
document
1659+
.network_interface
1660+
.set_input(&InputConnector::node(*node_id, 1), NodeInput::value(TaggedValue::U32(0), false), network_path);
1661+
}
1662+
16491663
// Migrate from the old source/target "Morph" node to the new vector table based "Morph" node.
16501664
// This doesn't produce exactly equivalent results in cases involving input vector tables with multiple rows.
16511665
// The old version would zip the source and target table rows, interpoleating each pair together.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc<WasmEdito
5757
implementation: DocumentNodeImplementation::ProtoNode(graphene_std::render_node::create_context::IDENTIFIER),
5858
context_features: graphene_std::ContextDependencies {
5959
extract: ContextFeatures::empty(),
60-
inject: ContextFeatures::REAL_TIME | ContextFeatures::ANIMATION_TIME | ContextFeatures::POINTER | ContextFeatures::FOOTPRINT | ContextFeatures::VARARGS,
60+
inject: ContextFeatures::REAL_TIME | ContextFeatures::ANIMATION_TIME | ContextFeatures::POINTER_POSITION | ContextFeatures::FOOTPRINT | ContextFeatures::VARARGS,
6161
},
6262
..Default::default()
6363
},

0 commit comments

Comments
 (0)