Using local $HIP path to manage shelf tools

   9588   6   0
User Avatar
Member
9384 posts
Joined: July 2007
Offline
I am trying to define some custom shelf tools and scripts inside my local $HIP directory using following folder structure on WIN:

$HIP
  L houdini
        L otls
        L scripts
               L python
        L toolbar
               L my_shelf.shelf
  L start_file.hip

according to this document http://www.sidefx.com/images/stories/tutorials/building_fxtools/building_fxtools.pdf [sidefx.com] chapter 6.

I am not sure if I understand it correctly, but I want to avoid setting environment variables like $HOUDINI_TOOLBAR_PATH
I just want to run my_file.hip and I am expecting my_shelf.shelf to appear in shelf + menu or directly in the shelf overriding default shelf, or appending to it or something. But it does nothing
(I even created and run start_file.hip directly, even if I don't thing the name of the hip file matters)

How is this supposed to work? I have no problems with otls relative to $HIP (and even if they are not directly in $HIP.houdini/otls) but I cannot get the shelf file to load automatically
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
I'm not sure what the document is thinking but there is no way that Houdini will search for tool, otl, and script folders inside a folder $HIP/houdini unless you specifically add that folder to the HOUDINI_PATH. $HIP/otls, $HIP/toolbar, $HIP/scripts, etc are all fine and work as expected but having them all located inside a houdini/ subdirectory is not going to work unless you specify that you should be searching that directory, either through the all encompassing HOUDINI_PATH or the more specific HOUDINI_TOOLBAR_PATH, HOUINI_SCRIPT_PATH or HOUDINI_OTLSCAN_PATH.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
9384 posts
Joined: July 2007
Offline
thanks graham

I was hoping for fast switching environments by including all tools local to the HIP file, so that different projects would have all shelves switched accordingly

HOUDINI_PATH does not work for me since it seems like it's exclusive, my houdini won't even start if I change the HOUDINI_PATH, because it cannot find some files in there

I have added
HOUDINI_PATH = “FPath/To/My/Custom/Houdini/Folder”
to houdini.env in my $HOME directory
is it the right way or do I have to add my folder to something that already exists in HOUDINI_PATH variable?

or what is the best way to manage all the ENV variables if I want to have my tools included in my $HIP directory and I want them to be found whenever I open my hip file?
So that if I open file from another project I get different shelves and scripts to work with?
Do I need (if it's possible) to execute python script to set this up for me whenever I open hip file?
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
I'd say probably your best best is to really just have all your hip file specificotl, script, toolbar folders at the same level as your .hip files so they are loaded in whenever you have your hip open. I'd then recommend putting more general things in something like a tool development directory or something and making the paths play nice.

My issue with that diagram in the pdf is that it is weird having that houdini/ directory in there. It seems totally unwarranted. It's not like you are going to have a maya/ folder inside your hip folder already so it seems pointless to have that extra level which just breaks things.

All the paths are exclusive if you set them, but if you set them and have & as the last entry then Houdini will also reference the default path, rather than having to specify the current directory, $HOME/houdiniX.Y dir and $HH.

Using this idea you can do things like this in the houdini.env file:

HOUDINI_PATH = /home/gthompson/tooldev/:&
HOUDINI_OTLSCAN_PATH = /home/gthompson/tooldev/otls/:&
HOUDINI_TOOLBAR_PATH = /home/gthompson/tooldev/toolbar/:&

Deciding on the best way to manage all your variables can be tough. I'm lucky that I use linux mosly, some OS X and since it's unix based it's easy to just deal with them all in my .bashrc. Personally I just really define my HOUDINI_PATH exactly as the first entry up above and that's about it. It picks up all my custom stuff, all the stuff in $HIP, $HOME/houdiniX.Y and $HH. On Windows, if I wasn't using cygwin, which I don't really care for, I'd probably do it all using houdini.env. It works pretty well but you can't script setting variables and such which is the down side.

I don't think trying to write any Python scripts would be useful. By the time HOudini is up and those things are run there's not much you can do. You can easily modify the Python path things, but by then it has already run its course with regards to all the shelf things and assets.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
9384 posts
Joined: July 2007
Offline
thank you graham for such valuable info

HOUDINI_PATH = FPath/To/My/Custom/Houdini/Folder/:&
gives me the same error about missing files and houdini refuses to start

strange thing is that when I run houdini without specifying ENV variables, HOUDINI_PATH is ‘<not defined>’ according to hconfig -a
so there is nothing to add to resulting in the same path as without “:&”
I must dig into it more deeply some day and understand those ENV variables

The great news it that as soon as I got rid of the “houdini” folder in my $HIP path, everything started working as I expected even without ENV variables
so there must be some logic and structure behind it, maybe just a mistake in that pdf document

Thank you graham for your help and patience, all is great now

Tomas
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
Sorry, my bad.

A couple of issues.

The actual path should be something like this:

CUsers/gthompson/Desktop/hip;&

I forgot that Windows uses the colon for the file paths. You need to separate the path with semi-colon instead.

Also, you can't set the HOUDINI_PATH (on Windows at least, I could swear it worked for me in linux) using the houdini.env file. Houdini can only find that file by looking in the path so by the time the file is read it is too late to set that stuff. You'll have to insert config variables like HOUDINI_PATH through the Advanced System Settings: Environment Variables dialog.

Also, the thing about the & is that you are right, nothing is technically defined then, but Houdini has a notion of its ‘default’ path. If it sees the & sign in a path it basically inserts the default stuff internally. If you just specify a path without that then it ignores it.

So with the above code setup through the env vars dialog I'm able to access assets and such located in that directory when I open Houdini from wherever and it all seems fine now.

Sorry for the screw up and confusion.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
9384 posts
Joined: July 2007
Offline
HOUDINI_PATH = FPath/To/My/Custom/Houdini/Folder/;&
in houdini.env works great, thank you
now it's starting to make sense to me
I'm very happy that local $HIP paths are working automatically and that ENV variables are working too if I need to have more centralized tool depository to share between the projects

Thanks again graham, very helpful
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links