imguidearpyguipyimgui

Using imgui from a python plugin


We have a C++ application that uses imgui extensively with very good results. We want to offer our users the possibility to write plugins in python, and to provide own controls for the plugins we would prefer that rendering of the plugin controls is done with the already active imgui context. Python has various imgui bindings (e.g. pyimgui, dearpygui). Is it possible to pass the already existing C++ imgui context to Python and draw windows, draw controls there, so they all show up in the common ui (in the same swap, with the same font ... etc)?


Solution

  • After a year of testing and developing now we have the best results with wrapping imgui with pybind11 like e.g done here https://github.com/cammm/deargui (version 1.65 may be a bit outdated).