ImGui Node Editor integration: introduction and acknowledgements #66
Pinned
pthom
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
imgui-node-editor provides a very advanced node editor built using Dear ImGui.
Python bindings
Using the python bindings
Using the python bindings works quite well, and is a pleasure to use. Here are some examples. And here is a 1 minute video demonstration of a possible usage inside python, around functions compositions.
Technical notes about the python bindings
The python bindings declarations are here: imgui_node_editor.pyi
In order to simplify the creation of NodeId, LinkId and PinId, a wrapper for those Id is provided in python.
When using the default context provided by ImmApp, there is a dedicated API
imgui-node-editor fork
The bindings are built on a fork of imgui-node-editor on the imgui_bundle branch.
This fork adds two small patches: a patch for an issue inside
ed::EditorContext::Begin
(for which a PR is proposed) and a patch that stores the SettingsFile under the form of a string (instead of a const char*), so that it can be modified from pythonIntegration inside ImmApp:
ImmApp is a thin extension of HelloImGui that enables to easily initialize the ImGuiBundle addons that require additional setup at startup (note: using ImmApp is perfectly optional. It is possible to instantiate a standard ImGui app manually)
Automatic context creation (C++ and Python)
When using ImmApp, a context for imgui-node-editor can be created/destroyed automatically, by filling an
AddOnsParams
structure.
For example, this C++ demo:
C++ demo code
can be run by simply adding this main function:
This global context is available via this api
Using ImmApp to quickly build a C++ app with imgui-node-editor:
The previous C++ example can be compiled standalone by simply adding this CMakeLists.txt from the _example_integration folder
(alternatively, HelloImGui provides a similar quickstart example, which can be used to compile an application where imgui-node-editor code is provided manually)
Beta Was this translation helpful? Give feedback.
All reactions