Closed exellian closed 1 year ago
You can use the input of the node and pass the value to the control like this:
worker(node, inputs, outputs) {
const n1 = inputs.num1.length ? inputs.num1[0] : node.data.num1;
const n2 = inputs.num2.length ? inputs.num2[0] : node.data.num2;
const sum = n1 + n2;
this.editor.nodes
.find((n) => n.id === node.id)
.controls.get("preview")
.setValue(sum);
outputs.num = sum;
}
where setValue is this function on the Control:
setValue(val) {
this.props.value = val.toFixed(3);
this.putData(this.key, val);
this.update();
}
If you need a full example I can share it with you
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Is it somehow possible to create an input socket for a control. I didn't find anything on docs. Or is there some way to workaround this?