Jump to content

Reading .env file from a centralized directory


underscoreus

Recommended Posts

Hi guys!

I'm working on simplifying the setup in the computer lab at the school I work for. In that regard, I've been looking at making a centralized houdini.env file to put on our server. The best-case scenario would be if there is a variable I can enter into the local houdini.env file to tell it to look elsewhere for the rest of the config since this would give flexibility incase some local overrides are needed. Does such a variable exist?

I've had a go trying to set PATH, HOUDINI_PATH, and HOUDINI_USER_PREF_DIR to a folder on my desktop as a test but neither seemed to give the result I wanted.

Thanks for the read!

Edited by underscoreus
Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the late reply, some other stuff came up, and had to put this project on ice for a week. I've gotten some of my setup working using a similar setup to what you suggested:
(Note that I:\ is a networked drive)

Quote

HOUDINI_PACKAGE_DIR = "I:\_pipeline\_release\Houdini\18_0\packages"
HOUDINI_PATH = "I:\_pipeline\_release\Houdini\18_0;&"

This does solve the issue (or at least some of it?) detailed in the original post. However, while Houdini now reads my custom scripts/toolbars from this folder it is unable to read the .json package files I have there. My original plan was to have another houdini.env file in this server folder with all of the variables, but after testing and finding that to not work I moved onto the package approach. Testing my .json files locally inside ".../Documents/houdini18.0/packages" they work perfectly, but when I move them to "I:/_pipeline/_release/Houdini/18_0/packages" they don't get read and any plugins like Redshift or Arnold don't get added.

If anyone's had success with this I'd love to hear from ya!

Link to comment
Share on other sites

Thanks for all of the replies!
I ended up doing something kind of similar. Since we don't adhere to a very strict pipeline system here I'm afraid making a dedicated launch script would bring the problem where students don't use it to launch Houdini, instead using the Houdini shortcut on the desktop or the start/search.

I ended up making a little function in the pythonrc.py file making sure that it copies all packages from the server to the local packages directory every time Houdini boots up, so far seems to work decently enough.

And if anyone coming to this thread in the future wants an example of what I made, here it is:

 

from shutil import copy2
import glob
from os import makedirs
from os import path
from getpass import getuser

versionNumber = hou.applicationVersionString()[0:-4]

source = r"I:/_pipeline/_release/Houdini/" + versionNumber + r"/packages"
dest = r"C:/Users/" + getuser() + r"/Documents/houdini" + versionNumber +r"/packages"

srcfiles = glob.glob(source + r"/*.json")

def wifmGetPackages():
    if path.exists(dest) == False:
        makedirs(dest)

    try:
        for f in srcfiles:
            copy2(f,dest)
    except Exception:
        print("Error in loading packages")


wifmGetPackages()

 

Link to comment
Share on other sites

  • 5 months later...

Hi Martin

I wondered if you stuck with this approach or found a better way of doing it? I'm trying to figure out how to get a small number of networked machines to share package files and have been struggling with the same issues... I'll try your method above - though I'm prototyping on a single non-networked machine. Presumably shouldn't be too difficult to roll out to the others if I can get it working.

Thanks!

 

Link to comment
Share on other sites

Thanks Andrii

When you say in each Houdini folder you mean on each machine?

I don't really know much about using a wrapper but I'll look into that as I'm trying to avoid maintaining all the machines' packages separately.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...