Possible to change Environment variable without closing?

   1155   1   0
User Avatar
Member
10 posts
Joined: 7月 2014
Offline
Hello,

I'm currently using this environment variable in my houdini.env

HOUDINI_OTLSCAN_PATH = C:/path/to/my/otls

But I would like to find a way to change it when opening a new scene file (i.e without closing Houdini) Is this possible?

Is there a command I can run to change it to:
HOUDINI_OTLSCAN_PATH = C:/new/path/to/my/new/otls
for example?

Thanks
Edited by GlassworksEng - 2021年3月5日 04:22:34
User Avatar
Member
57 posts
Joined: 7月 2018
Offline
Using Python in an open Houdini session, the function putenv() can set the env variable value, which can basically overwrite the existing one.

hou.putenv("HOUDINI_OTLSCAN_PATH", "C:/new/path/to/my/new/otls")

Reference: https://www.sidefx.com/docs/houdini/hom/hou/putenv.html [www.sidefx.com]
  • Quick Links