|On this page|
This example shows how to use the wxPython UI library to create a custom user interface inside Houdini by invoking wxPython’s event loop from Houdini’s event loop.
Houdini does not include the wxPython library, so if you want to use it you must first install it.
Since Houdini itself is based on the Qt UI library, if possible we recommend you use a Qt user interface library such as [PySide|, or use a python panel, to create custom user interfaces.
On Windows, make sure to install the library to the Python included with Houdini (in
Houdini install location/python).
If you haven’t installed wxPython first, you’ll get an error about
hou.sessionnot being able to import the
Choose Windows ▸ Python source editor to see the scene file’s Python module. It defines a simple “font chooser dialog” window class using
wx, as well as helper functions to patch the
wxevent loop and show the window.
Create a shelf tool to run the following code, or just type it into a Python shell (Windows ▸ Python shell):