thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.65k stars 536 forks source link

Is it the right tool for a generic node editor ? #42

Open SadE54 opened 4 years ago

SadE54 commented 4 years ago

Hi,

I don't know if your library is corresponding to my needs. Maybe you can help me to decide well :) The goal is to provide an easy way to users to design their own automatisms on embedded boards. I already developed the embedded stuff, and compiler to provided binaries from the graphs
And now , I need to develop a specific node editor with custom nodes. The graph could be loaded/saved as a json/xml, or whatever format (Only nodes list, connections, and positions list are saved). After that I have a compiler to produce specific binary files embedded on an embedded computer unit. So do you think your lib is fitting well that specs ? :

Yann

NotAPenguin0 commented 4 years ago

I am currently using this library to create a shader node editor, and it's working well so far. The only real thing you have to do is somehow connect the node and pin id's in your graph to the library's id's, which isn't that hard.

SadE54 commented 4 years ago

Is it possible to add input field for input pins in a node to setup a default value (scalar , string...) ?

thedmd commented 4 years ago

Hello @SadE54

Node editor provide callbacks to save it state. You may choose to save everything per graph or to save state of individual nodes. You can find that in Blueprint example where after every edit state of individual node is saved. It is represented as fading red line on node list. In other words you can save state in your data files.

We're using node editor for visual scripting where various types can be edited inline. image image

Yes it is possible to add input fields, buttons and various other widgets. In Blueprint example there is a "Hello" button next to some pins. image image As you can see nodes without input pin connected allow to input value directly. Edit mode is active after clicking on value. This is screenshot from our engine blueprints editor, samples do not cover all details. After all you can put in node whatever you want and make them look to your liking.

SadE54 commented 4 years ago

Waouhh , really nice :) I just compiled the Blueprint project , and it's pretty fancy ! I just started my project on .net wpf with https://github.com/Wouterdek/NodeNetwork, but I think I will switch to imgui and your lib . Have to learn back c++ :) One more question : I need some specific integer/float nodes with their own names (that can be changed ). Once compiled and programmed on my embedded system, the names could be displayed and the value changed by the user. For example there's a integer node feeding a timer node. I renamed it 'Pump delay'. Once processed and the automatism flashed on the embedded system , the user can access on the display to the parameter 'Pump Delay' and change the default value.

thedmd commented 4 years ago

Entire content of node is customizable. You can place labels to serve as title. You can place pins where you need them and orient them to your liking. "Node" is an rectangle where your content is drawn.

Blueprint example use custom node builder crafted for this example alone. You may choose to change default layout.