Skip to content

Commit c4ae3a5

Browse files
committed
Add "Loop Level" to the Position context reader node
1 parent 568831b commit c4ae3a5

6 files changed

Lines changed: 263 additions & 125 deletions

File tree

editor/src/messages/portfolio/document_migration.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,20 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
16321632
}
16331633
}
16341634

1635+
// Upgrade the "Instance Position" node to add the "Loop Level" input
1636+
if reference == DefinitionIdentifier::ProtoNode(graphene_std::vector_nodes::instance::instance_position::IDENTIFIER) && inputs_count < 2 {
1637+
let mut node_template = resolve_document_node_type(&reference)?.default_node_template();
1638+
document.network_interface.replace_implementation(node_id, network_path, &mut node_template);
1639+
let _ = document.network_interface.replace_inputs(node_id, network_path, &mut node_template);
1640+
1641+
document
1642+
.network_interface
1643+
.set_input(&InputConnector::node(*node_id, 0), NodeInput::value(TaggedValue::None, false), network_path);
1644+
document
1645+
.network_interface
1646+
.set_input(&InputConnector::node(*node_id, 1), NodeInput::value(TaggedValue::U32(0), false), network_path);
1647+
}
1648+
16351649
// Migrate from the old source/target "Morph" node to the new vector table based "Morph" node.
16361650
// This doesn't produce exactly equivalent results in cases involving input vector tables with multiple rows.
16371651
// 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)