Windows Environment Variable instead of .env file?

   1147   9   3
User Avatar
Member
11 posts
Joined: Feb. 2019
Offline
Hello! I've been on the hunt for a while to make Houdini setup on new clients as painless as possible. We currently use a custom .env file that points to various packages, HDA's, etc. Whenever a new user logs into a machine this houdini.env file needs to be manually put in their User/Documents folder for Houdini to properly work. I was curious if there is a Houdini solution like we use for Nuke (NUKE_PATH) & Maya (MAYA_APP_DIR) that uses a system environment variable that points the application to a network folder that contains these settings? Thanks all.
User Avatar
Member
93 posts
Joined: Dec. 2019
Offline
Hello,

You can place a package file in HFS/packages folder that points to your network packages directory (HFS is the houdini installation folder on the machine), this will be applied to all users. Or instead set the system environment variable HOUDINI_PACKAGE_DIR that is supposed to do what you are looking for.
Edited by ObeidaZakzak - Feb. 6, 2024 16:13:05
Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
11 posts
Joined: Feb. 2019
Offline
ObeidaZakzak
Hello,

You can place a package file in HFS/packages folder that points to your network packages directory (HFS is the houdini installation folder on the machine), this will be applied to all users. Or instead set the system environment variable HOUDINI_PACKAGE_DIR that is supposed to do what you are looking for.

Thank you - that is a great work around for packages, do you have any tips for HDA's as well? We are calling our shared HDA's folder in our environment file with the HOUDINI_OTLSCAN_PATH.
User Avatar
Member
253 posts
Joined: July 2013
Offline
Have a good look at https://www.sidefx.com/docs/houdini/ref/plugins.html [www.sidefx.com]

You can do it all, for example I have an additional second home folder that's layered on top of the default one in /documents.

In that folder are all the HDAs, desktops, shelf tools etc that I want shared between my workstation, laptop and render node. It's in repository so I can push updates and keep all the others in sync. But a shared network is drive, Dropbox etc will work fine as well.
Edited by Jonathan de Blok - Feb. 6, 2024 18:15:32
More code, less clicks.
User Avatar
Member
11 posts
Joined: Feb. 2019
Offline
Thanks Jonathan - this is really useful. So to avoid having to save these .json files on each client I could set the windows environment variable for $HOUDINI_PACKAGE_DIR to point to a network folder containing a .json folder with instructions for HDA paths and packages, correct?
User Avatar
Member
93 posts
Joined: Dec. 2019
Offline
Yes, the env var or the .json file placed on client's machine should only point to the shared network folder. Other instructions that specify which plugin to load should be done with .json files on the network side.
Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
127 posts
Joined: Jan. 2015
Offline
Have been using the "HOUDINI_PACKAGE_DIR" for two years now, works great! So much easier than using the Houdini.env
User Avatar
Member
253 posts
Joined: July 2013
Offline
And if you're really lazy, you can place a bat file in the root of the pipeline folder which if a user runs it, the path of the batchfile is used so set certain env vars.

For example the code below set JDB_ROOT to the location of the batchfile itself. It also set the package dir and some other vars. So if you are on a new machine and pulled the pipeline contents from a repo to any random folder, running the batchfile sets up the env so all software can find what it needs. This is also a good test case to weed out any hardcoded path since the pipeline root location can vary per machine. So if nothing breaks it's all good

set mypath=%~dp0
echo %mypath%
setx JDB_ROOT %mypath%
setx SYNTHEYES_SCRIPT_PATH %mypath%SynthEyes\Scripts\
setx HOUDINI_PACKAGE_DIR %mypath%Houdini\Packages
setx NUKE_PATH %mypath%Nuke\nuke_dir

pause

And the code below is the bare minimum to put on a json package file if you want add a homedir. So you save it as myAwesomePipeline.json in the folder that HOUDINI_PACKAGE_DIR points to and was set by the batchfile.

{

"env": [

{
"HOUDINI_PATH": "E:/GIT/JDB_Pipeline/Houdini/JDB",
}
]
}

In that folder you can now place items using the same folder structure as is used in the /documents. (So HDAs go in /otls etc).


Make sure to clean out the oldschool .env file if there is any and transfer everything to packages.
Edited by Jonathan de Blok - Feb. 7, 2024 08:33:49
More code, less clicks.
User Avatar
Member
11 posts
Joined: Feb. 2019
Offline
What a fantastic response Jonathan - thank you. Does the HOUDINI_PACKAGE_DIR take priority over the default documents folder? As houdini creates a clean houdini.env in documents on start up and I'd want to make sure the .env file in this new home directory takes priority.
User Avatar
Staff
398 posts
Joined: Feb. 2018
Offline
frame_48
What a fantastic response Jonathan - thank you. Does the HOUDINI_PACKAGE_DIR take priority over the default documents folder? As houdini creates a clean houdini.env in documents on start up and I'd want to make sure the .env file in this new home directory takes priority.

To clarify, package files always get priority over .env files and .env files are always loaded after all packages have been loaded.

Houdini will scan the following directories on startup (if they exist) for package files:

$HOUDINI_USER_PREF_DIR/packages

$HSITE/houdinimajor.minor/packages (for example, $HSITE/houdini18.0/packages)

$HOUDINI_PACKAGE_DIR
  * Houdini will process the package files directly in the directory specified in HOUDINI_PACKAGE_DIR, do not add a packages directory under these folders.

$HFS/packages

Note
$HSITE and $HOUDINI_PACKAGE_DIR must be set prior to start Houdini.

Houdini scans the package directories in the order specified above, it starts with $HOUDINI_USER_PREF_DIR/packages, then with $HSITE and so on. Furthermore, the package files are loaded alphabetically in the scope of a directory and the processing order can be changed with the process_order keyword.

Check out the documentation for more details:
https://www.sidefx.com/docs/houdini/ref/plugins.html [www.sidefx.com]
Edited by mabelzile - Feb. 7, 2024 16:21:09
  • Quick Links