rete icon indicating copy to clipboard operation
rete copied to clipboard

Dynamically change a node's structure based on its input

Open WieFel opened this issue 5 years ago • 5 comments

I want to change the structure of a node based on its connected input. At the beginning, the node should be connectable to any component (see the node Alteration below): no_connection

When having received a connection, the node's internal structure (controls+outputs) should be changed depending on the input, just like in the picture below: alt_position

As of now, when the "connectioncreate" event is triggered by the editor I am removing the "empty" Alteration node and adding a new "filled" node at the same position. However, using this approach, the connection mechanism between the nodes doesn't work properly and has some lags.

Is there any better option for manipulating a node's controls/outputs dynamically, e.g. whithin the worker()?

WieFel avatar Feb 12 '20 20:02 WieFel

Is there any better option for manipulating a node's controls/outputs dynamically, e.g. whithin the worker()?

The scheme shouldn't be modified in a worker(), since this changes will not affect current processing. Only some side effects are possible (for example, print log in node's control) that do not affect processing.

There are no problems with dynamic adding controls. As usual, node.addControl, and after that call await node.update();

Ni55aN avatar Feb 29 '20 10:02 Ni55aN

There are no problems with dynamic adding controls. As usual, node.addControl, and after that call await node.update();

Not working, control not updating. On the node class the changes but those changes are not rendered.

ilomon10 avatar Sep 22 '20 15:09 ilomon10

There are no problems with dynamic adding controls. As usual, node.addControl, and after that call await node.update();

Not working, control not updating. On the node class the changes but those changes are not rendered.

+1, not working

v1talii-dev avatar Dec 29 '20 08:12 v1talii-dev

how call builder() and redraw node, after data object change?

v1talii-dev avatar Dec 29 '20 09:12 v1talii-dev

I don't know for other render plugins, but with Vue.js I had to call this.$forceUpdate() on the node vue component to see the result.

kvnbra avatar Dec 29 '20 10:12 kvnbra

same problem

montasIET avatar Mar 08 '23 15:03 montasIET

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.

rete-js[bot] avatar Jul 13 '23 10:07 rete-js[bot]