README for sourceHoudini.py This Python script is intended to be run from a unix shell environment and is used to easily source a Houdini environment. The script works by utilizing the houdiniutils.py module to search the system for installed Houdini builds and allow you various flexibility to source an environment. By default the script expects that you have installed Houdini in the default location on either linux or OS X. This can also be changed in the module. This system works by writing the install path ($HFS) to a temp file which can then be read to provide a path from which to initialize Houdini. Various arguments can be passed to the script to help specify which exact build is desired. If an invalid arg is passed or the specified build cannot be found an error is printed to stderr and the latest version is chosen. - No args will result in the latest build (highest number) being sourced. - The character 'l' or 'list' will result in a list of all found builds being displayed and prompting for a choice. - 1 or 2 digits means major build (9.#.#, 10.#.#, 11.#.#, etc.) - 3 digits means build number (#.#.361, #.#.725, etc.) Pieces are '.' separated and can be used for major/minor or full version selection. - 2 pieces means we are trying to choose with a major + minor choice. (9.5, 10.0, 10.5, etc) - 3 pieces means we are trying to choose with a full build number (11.0.123) Here is an example of using it from within the .bashrc file. In this example HOUDINI_UTIL_SCRIPT_PATH is the path where this file is located. sourceHoudini() { # Execute the script passing in any args we might want. ${HOUDINI_UTIL_SCRIPT_PATH}/sourceHoudini.py $@ # If there is no source_houdini file in /tmp then we just bail if [ ! -f /tmp/source_houdini ]; then return fi # Get the directory path from the file, store it then remove the temp file. export HPATH=`tail /tmp/source_houdini` rm /tmp/source_houdini # Make sure we got a path. if [ -z $HPATH ]; then return fi # Change to the install dir, source houdini_setup and then return to # where we were originally. pushd $HPATH 1>/dev/null && source houdini_setup && popd 1>/dev/null # Unset our install path. unset HPATH }