Replies: 4 comments 1 reply
-
Hello! First of all - no apologies needed for making awesome stuff! My twitter comment may have sounded different from what i intended. When i saw your bindings i was simply blown away :) I was working on mine quietly, without publishing them. It is not a trivial task, and i am making them as i go, while working on a personal project (which has some overlap with imgui bundle - i am also interested in implot applications within ipython notebooks). I am also using SWIG (for better or worse). Though on a deeper look i decided to continue working on my bindings just a little bit more, since imgui bundle does not quite cover everything i need (which would be at very least implot_internal.h). Reason that led me to find bindings generator was me needing to customize bindings output to migrate my project, im not quite willing to drop my conventions just yet... In my bindings i dropped On the APIs in question... The reason i used But eh.. I am not working on this library much (as can be seen from commit history). I think it would be more valuable to wrap this project instead: https://github.com/thedmd/imgui-node-editor |
Beta Was this translation helpful? Give feedback.
-
Hi ! Many thanks for your message, and happy to read that you are pursuing your work on your generator.
In ImGui Bundle you will find a somewhat comparable convention, with things like TimeUnit = int # enum TimeUnit_
# ...
class TimeUnit_(enum.Enum):
# ImPlotTimeUnit_Us, /* original C++ signature */
us = enum.auto() # (= 0) # microsecond
# ImPlotTimeUnit_Ms, /* original C++ signature */
ms = enum.auto() # (= 1) # millisecond
# ...
I had not seen the need for this one. Anyhow, I spent sometime studying if the generator could swallow it. It seems like it can, and it gave me this result, which I was able to compile and use with python (beware, this is work in progress, and I tested only one or two python binding in the internal module). See related commit in the implot_internal branch. I had to exclude some functions, see generate_implot.py : the functions I had to exclude were mainly time related, and DateTime format related (since they were using a C style output char * buffer) Concerning your library, thanks for the suggestions ! I'm not sure using PyObject would be recommended with pybind11 (which is closer to C++ than swig). Concerning thedmd/imgui-node-editor, I ported already; and it is working nicely. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This is definitively interesting, and close to a subject I would like to explore, i.e. improve Notebook integration. I had written a draft idea on how to better integrate ImGuiBundle with a notebook (see here). I'll take a look at your ideas, thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello Rokas,
@rokups: once again, as I answered to you on twitter, I am sorry if my work on ImGui Bundle may have impacted your work on a imgui python bindings project.
I was not aware about your efforts on this subject, although it is true that I did not communicate with Omar about my project during its development, and maybe I should have done this sooner. If you feel so, please accept my apologies.
The truth is I wanted to be as polished as possible before communicating about it. Also, I faced quite a lot of challenges during development, especially when porting imgui_internal; and I was not sure I could overcome them all.
I studied your library api while working on ImGui Bundle, and I did not have enough time to bind it initially.
Anyhow, I saw that you discovered the repository of the generator. If you are interested, I could investigate with you how ImNodes could be added into the bindings. This would probably require some adaptations on the API side, since pybind11 is quite limited about opaque types.
Concretely, this would mean that for example this part of the API:
would need to be wrapped so that
void *
is represented as a type that pybind11 can understand (maybeuinptr_t
), and so that the outputs of the function are grouped. pybind11 will not handle double pointers, and output parameters are better represented by returning a tuple or a basic struct in python.maybe something like this:
This is only a draft, as I do not know ImNodes enough ;-)
Thanks,
Pascal Thomet
Beta Was this translation helpful? Give feedback.
All reactions