Jump to content

set $JOB relate to $HIP?


poppy

Recommended Posts

Hi,

Is there a way to set $JOB accorsding to $HIP?

Say, I have

Project

/scene

/render

/cache

My $HIP is /Project/scene

Can I set $JOB to $HIP/../ ? I use both Win and Linux, I have to set $JOB by hand everytime I open in diffrent OS.

Thanks!

Link to comment
Share on other sites

  • 3 months later...

I've set up qLib and most of the otls work with the exception of the environment

 

In Windows houdini.env I set HSITE to point toward the site_evironment.py

 

but I keep getting error on the loading of the file:

 

OOPS: couldn't find C:/Users/myname/houdini13.0/site_environment.py

 

Thanks for any help on this.

Edited by motionprojects
Link to comment
Share on other sites

  • 1 year later...

Hi,

I'm digging back this old thread because i have mainly this same problem.

 

- I'm in the need for a project oriented structure like $JOB (essentially allowing to sort hip files by shots etc)

- I'm rendering with a mixed operating systems (win and osx), so the path needs to be set via an env variable, $HIP works great for this

- I've tried the new $HOUDINI_PATHMAP but this doesn't change $JOB

 

unfortunatly $JOB is written in the hip file so any attempts to set $JOB in houdini.env fail

 

I've qlib up and running for a long time but this doesn't change anything because getting my hand on python scripts like the one here (site_environment.py.txtis way out of my head

 

Does a simple solution exist, telling houdini to doesn't include $JOB path in hip ?

 

Thanks

  • Like 1
Link to comment
Share on other sites

hi, Noel,

assuming your project set-up looks somewhat similar to:

Proj($JOB)/

    Renders/

    Scenes/

        shot/

    Cache/

 

rename  proj_env.py.txt to proj_env.py

proj_env.py.txt

 

place this file into  your project folder,

save hip into scenes folder

add environment_ql node to your scene file

 

try moving whole project to a different location, open hip without redefining project(JOB) manually, does the JOB variable update? you should see it in environment_ql node.

 

Link to comment
Share on other sites

Olala that's working !!!

 

So if i may... 

 

To be perfectly free i would like to move back from the hip file to the actual project folder name without passing through a scene folder, that would be ideal...

 

I assume in the "for i" statement i would write my project name in place of "scenes"

But how can i tell in python to use that actual projectname found to be the actual $JOB seems? Seems if i just remove the "path.pop()", i'm really close ;-)

 

But i have to thank you, actually i understand now how that's working at least

Link to comment
Share on other sites

Hi,

I'm setting up now project based otls and taking your first example file i see:

 

Here you import hda's it's ok and working

OTL_PATTERN = JOB + '/Assets/Otls/*.otl'
But here:

What this part is doing exactly ??

os.environ['HOUDINI_OTLSCAN_PATH'] = JOB + '/Assets/Otls' + ";" + os.environ['HOUDINI_OTLSCAN_PATH']
hda_rescanOTL.rescanOTL()

I'm asking because I don't have a fixed path like in the example but i'm with a path with wilcards and this is not working ...

In my case I have 

OTL_PATTERN = JOB + '/*/hda/*.hda'

how can i add that to the scanpath ?

 

Thanks !

Edited by NNois
Link to comment
Share on other sites

Hi,

if i recall correctly OTL_PATTERN didn't work for me so i manually added all the folders and sub folders with hda's and the forced the refresh. You can walk through the dir tree with:

    def indexPath(directory, ignore_list = []):
        '''index returns list of dirs and subdirs ignoring dirs provided in ignore_list
            like os.listdir, but traverses directory trees'''
        stack = [directory]
        dir_list = []
        while stack:
            directory = stack.pop()
            for obj in os.listdir(directory):
                fullname = os.path.join(directory, obj)
                if os.path.isdir(fullname) and obj not in ignore_list:
                    dir_list.append(fullname)
                if os.path.isdir(fullname) and not os.path.islink(fullname) and obj not in ignore_list:
                    stack.append(fullname)
        return dir_list
  • Like 1
Link to comment
Share on other sites

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