Add node introspection API

Closes #1110

Test Plan: query the introspectNode Endpoint from js

Reviewers: 

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1183
This commit is contained in:
Dennis Kobert
2023-04-28 00:20:39 +02:00
committed by Keavon Chambers
parent 0af42ee6f9
commit bea7cc8dd0
6 changed files with 48 additions and 5 deletions

View File

@@ -51,6 +51,10 @@ impl NodeGraphExecutor {
}
}
pub fn introspect_node(&self, path: &[NodeId]) -> Option<String> {
self.executor.introspect(path).flatten()
}
/// Computes an input for a node in the graph
pub fn compute_input<T: dyn_any::StaticType>(&mut self, old_network: &NodeNetwork, node_path: &[NodeId], mut input_index: usize, editor_api: Cow<EditorApi<'_>>) -> Result<T, String> {
let mut network = old_network.clone();