mathieuN Posted September 1, 2016 Share Posted September 1, 2016 Hi Evryone, I am currently building a Houdini pipeline in order to link it to shotgun. Everything work well and pretty easily. but there is a but. I am setting the env var JOB with the command set or setenv it`s the same. Each time I re-open the hip file my job env is not set correctly. Houdini keep the older JOB variables. And if I do the same manip into the UI in the aliases and variables it`s work well. I do not understand why. Many there is a logic. If anyone know please tell me. thanks mathieu Quote Link to comment Share on other sites More sharing options...
MirrorSword Posted September 1, 2016 Share Posted September 1, 2016 I remember reading that Houdini saves the JOB env with the hip file. But it sounds like you want it to automatically update to whatever env you have set in your shell. Maybe you could add something to you 456.py to reset the JOB env. Something like this maybe. import hou import os hou.putenv("JOB",os.environ["JOB"]) Quote Link to comment Share on other sites More sharing options...
mathieuN Posted September 2, 2016 Author Share Posted September 2, 2016 Thanks for you reply. But it s still doesn`t work for me. Just to be clear, I want to change the $JOB inside my scene with using the 123.py and 456.py. With this method I can change the context of any shots with reloading houdini. And just to be clear, I need $JOB for HQUEUE server because without a $HIP or $JOB it doesn`t work. I gonna continue to find a good solution for this problem. thanks again for your reply. Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted September 2, 2016 Share Posted September 2, 2016 (edited) Setting environment variables with python from inside a running Houdini instance is messy and not working as expected. I've had more success using the equivalent hscript commands. hou.hscript("setenv JOB = foobar") hou.hscript("varchange JOB") # this is optional and probably not needed in your case Hope this will work for you. Cheers, Dennis Edited September 2, 2016 by dennis.albus 1 1 Quote Link to comment Share on other sites More sharing options...
mathieuN Posted September 2, 2016 Author Share Posted September 2, 2016 Thanks dennis, The value change when you execute the syntax, but when you re-open your scene the value is reinitialize. thanks a lot mathieu Quote Link to comment Share on other sites More sharing options...
edward Posted September 3, 2016 Share Posted September 3, 2016 Try setting os.environ["JOB"] from Python, and then calling hou.allowEnvironmentToOverwriteVariable("JOB") before loading your .hip file. 2 Quote Link to comment Share on other sites More sharing options...
yongbin Posted September 28, 2017 Share Posted September 28, 2017 I checked help document, it is hou.allowEnvironmentToOverwriteVariable("JOB", True) in houdini16 2 Quote Link to comment Share on other sites More sharing options...
kgmcnamara Posted October 12, 2017 Share Posted October 12, 2017 I swear I run into this problem every time I have to set up a new Houdini pipeline and it takes me twenty minutes to find this thread again. Thanks Edward and Yongbin - that's the line I'm always missing. Quote Link to comment Share on other sites More sharing options...
Tyfx567 Posted March 18, 2018 Share Posted March 18, 2018 mathieuN, Can you help me get started in connecting python with shotgun? I would like to develop a quick access your shots browser in houdini. The browser would find that user name and limit the shots, episodes, show, based on that user name. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.