Change file browser

   4641   9   4
User Avatar
Member
24 posts
Joined: June 2019
Offline
Hi,

I was wondering: Is it possible to set Houdini's file browser to be the normal Finder file browser on Mac? Just like you can with the help?

https://houdinitricks.com/default-web-browser-houdini-docs/ [houdinitricks.com]

As you see here.

Thanks,
User Avatar
Staff
727 posts
Joined: Oct. 2012
Offline
You should be able to use the HOUDINI_USE_NATIVE_FILE_CHOOSERenvironment variable
User Avatar
Member
24 posts
Joined: June 2019
Offline
I have set that to 1 now, but when I relaunch Houdini and click File>Open, I still get the Houdini browser. Same if I set it to zero.

Am i doing something wrong?
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
Did you change the preferences? There is a setting in the Houdini preferences for Native browser.
>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
User Avatar
Member
24 posts
Joined: June 2019
Offline
Thanks!
User Avatar
Member
7741 posts
Joined: Sept. 2011
Offline
Doesn't this preclude the ability to automatically open sequences using $F4? What is the benefit in a native file browser? On windows I can see wanting to have the same shortcuts, but it's not that hard to add stuff to the jump list.

I admit in real use, I rarely ever use the houdini file browser. Everthing is brought in through pipelined otls, database browser tools and other qt guis. Using a file browser at all is sort of going rogue.
User Avatar
Member
251 posts
Joined: July 2013
Offline
If you add this to your PARMmenu.xml you'll get an additional ‘pick file’ option in every file type parm's contextmenu. It will give open your native browser so you can comfortably browse and do stuff. This works side-by-side with the houdini browser so you can use the one best for the task at hand:


<scriptItem id="PickFileNative">
<context>
<expression>
<![CDATA[
try:
return kwargs["parms"][0].parmTemplate().stringType().name()=='FileReference'
except:
return False
]]>
</expression>
</context>
<label>Pick File</label>
<scriptCode>
<![CDATA[
import sys
import os
from PySide2 import QtCore, QtGui, QtWidgets

path=os.getcwd()
try:
path=(os.environ['hip'])
except:
pass

try:
if os.path.dirname(kwargs["parms"][0].eval())!='':
path=os.path.dirname(kwargs["parms"][0].eval())
except:
pass

filename = QtWidgets.QFileDialog.getOpenFileName(None, 'Pick a File', path, 'All Files(*.*)')
if (filename[0]!=''):
kwargs["parms"][0].set(filename[0])
]]>
</scriptCode>
</scriptItem>
Edited by Jonathan de Blok - Jan. 6, 2020 12:43:21
More code, less clicks.
User Avatar
Member
620 posts
Joined: Nov. 2013
Offline
Jonathan de Blok
If you add this to your PARMmenu.xml

Which point should add this code?
User Avatar
Member
251 posts
Joined: July 2013
Offline
jerry7
Jonathan de Blok
If you add this to your PARMmenu.xml

Which point should add this code?

Find the PARMmenu.xml and in there look for

<scriptitem>
….
</scriptitem>

blocks. The code for the browser is such a block as well. In textport panel you can do a ‘menurefresh’ to make it work without restarting Houdini.
More code, less clicks.
  • Quick Links