Hou.putenv Error

   3222   2   1
User Avatar
Member
33 posts
Joined: May 2015
Offline
I need to set some environment variables, attached to a scene.

Ex: hou.putEnv('RENDER', ‘/path/to/my/projectA/projectARenderFolder’)

I could have to update that variable several times within a houdini session:

IE:
Open scene B
hou.putEnv('RENDER', ‘/path/to/my/projectB/projectBRenderFolder’)

Open Scene C
hou.putEnv('RENDER', ‘/path/to/my/projectC/projectCRenderFolder’)

Having an outputPath (mantra), using environment variable works well within houdini session…

$RENDER/$OS/$F.exr …

However, when I save scene, reopen, or send it to farm, $RENDER is not defined anymore.

Is it possible to declare a variable, and making it ‘saved’ in current scene?
hou.putenv('RENDER', ‘/x/x/’)

thanks,
Jonathan
User Avatar
Member
3 posts
Joined: Nov. 2016
Offline
If the question is still on, here's the answer:
You should use this:

hou.hscript('set -g ' + 'RENDER' + ' = ' + '/path/to/my/projectC/projectCRenderFolder')
User Avatar
Member
136 posts
Joined: Oct. 2020
Offline
I am using hou.putenv and it doesnt get saved with the scene. I can confirm the hscript method works. thanks.
https://www.youtube.com/channel/UC4NQi8wpYUbR9wLolfHrZVA [www.youtube.com]
  • Quick Links