Arun S

ninjismo

About Me

EXPERTISE
VFX Artist

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Python - How do you select a folder? May 25, 2020, 4:50 a.m.

Solution -

There's a file_type option called “Directory” that does this. Must have missed it while I was looking through the docs -
hou.ui.selectFile(file_type=hou.fileType.Directory)

Python - How do you select a folder? May 16, 2020, 2:45 a.m.

Hi!

I'm working on a Python tool that allows users on Linux to search any folder they like for files containing a certain extension / keyword.

To do this, a dialog comes up asking them for a string of the folder location they'd like to search and a keyword to search for, like so -

start_popup = hou.ui.readMultiInput(start_message,
                                    ("Path to Search", "File to Look For"),
                                    initial_contents=(home_dir, ".exr"),
                                    title="File Finder",
                                    buttons=('OK', 'Cancel'),
                                    default_choice=0,
                                    close_choice=1)

I wanted to know if there was a way for the user to get a popup which is something like what hou.ui.selectFile() does, but for a folder instead?

That way I could use the output of the ‘selectFolder’ to populate the
'Path to Search' field and the user doesn't need to paste / type out the folder to search into.

Any help would be appreciated!