You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
Hi, I am trying to build a noise visualizer. Noises like Fractal Brownian Motion take in a number of other noise functions to combine them. I wanted to support this by adding new inputs as the user adds new ones. Below Is my code:
fn input<S: AsRef<str>>(self, graph: &mut MyGraph, node_id: NodeId, name: S) -> InputId {
let value: MyValueType = match self {
[...]
};
graph.add_input_param(
node_id,
name.as_ref().to_string(),
self,
value,
InputParamKind::ConnectionOrConstant,
true,
)
}
fn multi_input<S: AsRef<str>>(self, graph: &mut MyGraph, node_id: NodeId, name: S) {
for i in 1.. {
let input = self.input(graph, node_id, format!("{}_{i}", name.as_ref()));
if dbg!(graph.connection(input)).is_none() {
break;
}
}
}
In theory, since egui is immediate mode, I thought hey, just keep adding inputs as long as the inputs are connected, thus ensuring there is always one more input that connections. However, as it turns out, egui_node_graph does some caching and thus, the node is not updated. Is there a way to create a varying number of inputs?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am trying to build a noise visualizer. Noises like Fractal Brownian Motion take in a number of other noise functions to combine them. I wanted to support this by adding new inputs as the user adds new ones. Below Is my code:
In theory, since egui is immediate mode, I thought hey, just keep adding inputs as long as the inputs are connected, thus ensuring there is always one more input that connections. However, as it turns out, egui_node_graph does some caching and thus, the node is not updated. Is there a way to create a varying number of inputs?
Beta Was this translation helpful? Give feedback.
All reactions