egui_node_graph icon indicating copy to clipboard operation
egui_node_graph copied to clipboard

Remove Widget on input connection

Open atoav opened this issue 2 years ago • 1 comments
trafficstars

This is less of an issue more of a question:

I tried for a while to find a way to "bind" inputs to a widget in order to emulate the behaviour in Blender's node editor. In Blender it behaves as follows:

  • each Widget has a corresponding input
  • if you connect something to that input, the widget is hidden and the set value ignored
  • if you disconnect that input the widget is shown and the previously set value restored

I suspected the way to do this is to remove the widget when the onConnectionsChange callback fires, however I did not find a removeWidget method that I could have used to remove that widget. Any pointers are welcome.

atoav avatar Apr 21 '23 16:04 atoav

I don't understand your exact concern, widgets already only render for disconnected inputs. image image

Those are screenshots from the demo app.

I have the patch for the opposite behavior (allow rendering some widget UI even if an input is connected), but I'm waiting for #85 to be merged first.

kamirr avatar Apr 27 '23 04:04 kamirr