Jump to content
Mossman

File Browser default Path

Recommended Posts

Hi there!

First post of another ex-Softimage user migrating to Houdini land. Very exciting! I'm currently trying to integrate Houdini into our pipeline. And something I always wanted to do (but couldn't) inside Softimage is to dynamically change the default path of the file browser. So if the user wants to import images, geo, ... the file browser would directly jump to the right location, ideally based on env variables like $JOB. Is this possible with Houdini? I've been searching through the various config files but I couldn't find the one setting the default path. Currently it appears to bei either $HIP or the most recent location. 

Thanks!

Share this post


Link to post
Share on other sites

inside your $HOME/houdini15.5/

there is a file called jump.pref (if there isn't you can make one)

in this file you can list paths (with env vars)

like this:

$PROJECT/$ASSET/geo/

/mnt/someDir/someOtherDir

now these paths will show up on the left hand side of the file browser as 'favorites'

 

Share this post


Link to post
Share on other sites

Cool, that's a good start, thanks! Maybe there is also a way to set the path directly? Also it would be nice to set different directories in case the user want's to import images, geo, etc.

Share this post


Link to post
Share on other sites

not sure what you mean by 'set the path directly'

when in Houdini you can browse to a folder and then set a 'favourite' which will add that path to the jump.pref

  • Like 1

Share this post


Link to post
Share on other sites

What I mean is that the browser opens and the user is directly in the right directory without having to click on a favourite and depending on the type of file he wants to import. But if that's not possible your trick with jump.pref will suffice for now. Thanks again!

Share this post


Link to post
Share on other sites

Not sure if you've tried this, but if you put the "right" path in the file parm (with or without a file name) before you open the browser, the browser will open in that dir.  So if your utility knows where it's supposed to look, you can programatically put the right path in the file parm first.  

  • Like 1

Share this post


Link to post
Share on other sites

You can using houdini scripted UIs (selectFile is what you want)

https://www.sidefx.com/docs/houdini/hom/hou/ui

From the docs:

selectFile(start_directory=None, title=None, collapse_sequences=False, file_type=hou.fileType.None, pattern=None, default_value=None, multiple_select=False, image_chooser=False, chooser_mode=hou.fileChooserMode.ReadAndWrite) str

So for example:

dialog = hou.ui.selectFile(start_directory=hou.hscriptExpression("$JOB"), title='Select your file', file_type=hou.fileType.Image)

You can make start_directory a $VARIABLE or something more explicit like "/my_folder/images/"

 

 

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

×