So I have put some environment variables as the storage location in file management. My method did require me to change files in C:\Program Files\Shotgun\Python\Lib\os.py. This obviously isn’t ideal. Is there a preferred way to put environment variables as storage? Or a preferred way to override that python file?
Are the env vars consistent across all users?
They would be, yes.
Unfortunately we don’t provide a way at the moment to use an environment variable in a storage root.
However if you were to modify our code to do it, I would have thought the changes should be made to
tk-core and maybe the
tk-framework-desktopserver and not to the
I’ve logged a request on our roadmap page on your behalf.
Yup, we had to do this for a client to have per-user roots (perforce setup).
If the env var changes, you’ll have to use a “dummy” path for any paths stored as filesystem locations and then in the files Phil mentions, translate that path to/from the env var path when reading or writing to the database. It seems to work ok amazingly!.. but no doubt there are some failure cases that I’ve not discovered yet.
One other area you will have to update are all the workfiles, and loader2 hooks that might not expand the env vars in paths.
Any update on this?
This seems like a “simple” powerful request to be able to support. Requiring everyone on Windows/platform to use the same path is too much of an ask, and supporting an environment variable path would be a huge win.