Jump to content

Proper external close of hou.ui.selectFile() and hou.ui.selectNode()

Recommended Posts

Dear colleagues,

Houdini provides developers with an option to open the File-/Node-Dialog (such as hou.ui.selectFile() and hou.ui.selectNode()). However, in case I call it from the external QWidget, in my case it is PySide2. If I close this PySide2's QWindow, obviously, it causes the Houdini crash, because hou.ui.selectFile() should return a string to the PySide2's QWidget parent.

Here is an example:

I have a tool on the Shelf, it opens PySide2 QWidget. Imagine there is a button which opens hou.ui.selectFile() or hou.ui.selectNode(). After calling this function, Houdini creates one more subwindow with File-/Node-Dialog respectively. However, if I close QWidget, any of two select functions return a result to non-existed at the moment sub-application. It causes Houdini crash.

I am looking for how can I take the reference to this File-/Node Dialog to properly terminate it on closeEvent(self, event), because disabling QWidget's UI, while File-/Node Dialog is open, doesn't seem to be the best solution.


One of the possible answers might be: use PySide2's File Dialogs. What seems to be ok for the File-/Path-Dialog, but it might take time to produce custom hou.ui.selectNode(). 

Thank you in advance!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now