Jump to content

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!

Share this post


Link to post
Share on other sites

Hi,

yes, there are lots of ways

i'm doing it with qLib's "environment_ql.otl" and some env.py :)

its part of scripts that i use to initialize environment variables, but for certain task it should suffice

site_environment.py.txt

P.S. its not allowed to attach *.py files? :?

Edited by Owl
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Owl,

However, honestly, I dont know what to do with your kindly provided file. :P I mean I know way around otl, but never touch python file in Houdini.

Could you please explain more?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×