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
Hi,
I am using the built-in interfaces (like TextInputInterface, SelectInterface, etc) with built-in types like number and string, and this works great so far. But my nodes also have to accept a special variable type which gets resolved later in the calculate method where all node input is processed and the result is created and passed to the next node in the chain.
Example: my node has a number input port with a number editor. The user is able to enter a number or connect a number output of another node. But they also have to be able to connect a string output to this port; in that case, the calculate method would process the value as a string.
Is this supported somehow? Or what would be the most straightforward way to implement such a feature?
I think I could create a custom class which accepts all the required values and provide custom editors (inherited from NodeInterface), but that would practically mean rewriting all the existing components and I wouldn't really want that. Or maybe I could use a custom class to store the data passed between the nodes, but still use the predefined interfaces? It would be trivial to write conversion methods which would convert my class to a number or string, but as soon as I try to use a NodeInterfaceType with DynamicNodeDefinition or the predefined Interfaces, I get tons of different errors, so that seems to be a dead end.
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 using the built-in interfaces (like TextInputInterface, SelectInterface, etc) with built-in types like number and string, and this works great so far. But my nodes also have to accept a special variable type which gets resolved later in the calculate method where all node input is processed and the result is created and passed to the next node in the chain.
Example: my node has a number input port with a number editor. The user is able to enter a number or connect a number output of another node. But they also have to be able to connect a string output to this port; in that case, the calculate method would process the value as a string.
Is this supported somehow? Or what would be the most straightforward way to implement such a feature?
I think I could create a custom class which accepts all the required values and provide custom editors (inherited from NodeInterface), but that would practically mean rewriting all the existing components and I wouldn't really want that. Or maybe I could use a custom class to store the data passed between the nodes, but still use the predefined interfaces? It would be trivial to write conversion methods which would convert my class to a number or string, but as soon as I try to use a NodeInterfaceType with DynamicNodeDefinition or the predefined Interfaces, I get tons of different errors, so that seems to be a dead end.
Beta Was this translation helpful? Give feedback.
All reactions