What's the best way to show up a GUI from my menu entry and interact with a C++ lib in the GUI?

   640   1   0
User Avatar
Member
75 posts
Joined: Oct. 2018
Offline
I got a request to insert an entry into the Windows menu of Houdini, when this menu entry is clicked, it should show a GUI, with some input controls to let user input something as parameters, and a button to call the APIs provided by our own C++ lib. After the button is clicked, the status of the C++ lib should be updated on the GUI.

What I got currently is I customized a MainMenuCommon.xml and inserted my own menu entry under the Windows menu.

Then I tried defining a dialog using Houdini's UI script and then using the builduicode.exe tool to generate a pair of .c/h file in hoping that I can interact with the C++ lib in the callbacks of the UI elements, but I don't know how to show this UI from my added menu entry. Is this the correct way to do the task, or is there any better ways?

I'm on Houdini 16.5.

Any suggestions/comments is welcome!

Thanks!
User Avatar
Member
75 posts
Joined: Oct. 2018
Offline
I have made it work in this way:

1. define a command in c++, say my_cmd; in the command, open up the dialog I defined
2. install the command in CMDextendLibrary
3. make a .py file to call the command, the py file is quite simple
hou.hscript('my_cmd')
4. execute the .py file in my inserted menu entry

Although it worked, as I still new to Houdini, I'm not sure if this is the recommended way in Houdini, or is there any better ways?
Thanks for any inputs!
  • Quick Links