Jump to content

JOB variables problem with setenv


mathieuN

Recommended Posts

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

 

 

 

Link to comment
Share on other sites

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"])

 

Link to comment
Share on other sites

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.

 

 

 

Link to comment
Share on other sites

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 by dennis.albus
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...
  • 5 months later...

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...