Current Showreel

Monday 5 April 2021

Learning Houdini - part 3 - Running from terminal

To run a python script on a houdini hip file from the cmd line without opening at GUI version of houdini use the syntax below:

/opt/hfs18.5/bin/hython <YOUR_HIP_FILE> <YOUR_PY_SCRIPT>


Haven't yet checked about passing args to the py script but will edit and update with that later.

Learning Houdini - Part 2 - Adding Menu's and importing modules

Below is what I've found about being able to add custom menus and importing scripts into Houdini (for use on shelf buttons etc). 

Setting up the houdini.env file 

The houdini.env file is exactly like Maya's maya.env file. You'll find in:

$HOME/houdini18.5/houdini.env

aka

~/houdini18.5/houdini.env

The official documentation about this is here

Adding python modules

Super simple. Just add the path(s) to where your code modules are to the PYTHONPATH env var in the houdini.env file. Separate each path with : or ; (both should work although : is more linux-y)

eg:

PYTHONPATH=/path/to/my/custom/scripts:/other/path/to/scripts

The official documentation about this is here

Adding custom menus

This is more fiddly. The official documentation about this is here

Firstly you need to set the HOUDINI_MENU_PATH in your houdini.env to point at where your menu's are, and you must make sure to use the :& after you put the path in, otherwise it will only load the menu that you've created there. See the examples below:

This will only load the menu's you've set in that path

HOUDINI_MENU_PATH=$HOME/path/to/menus

This will effectivly append your menu to the default set of menus

HOUDINI_MENU_PATH=$HOME/path/to/menus:&

Nb: if you do this:

HOUDINI_MENU_PATH=&:$HOME/path/to/menus

Then your menu will be inserted before any other menus (so i'll appear on the left-most side of the menu bar, before the "File" menu.

Menu files are xml files that have to have specific names, and syntax that's detailed in the documentation linked above.