poppy Posted October 11, 2013 Share Posted October 11, 2013 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! Quote Link to comment Share on other sites More sharing options...
Owl Posted October 11, 2013 Share Posted October 11, 2013 (edited) 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 October 11, 2013 by Owl 1 Quote Link to comment Share on other sites More sharing options...
poppy Posted October 12, 2013 Author Share Posted October 12, 2013 Thanks Owl, However, honestly, I dont know what to do with your kindly provided file. I mean I know way around otl, but never touch python file in Houdini. Could you please explain more? Quote Link to comment Share on other sites More sharing options...
Owl Posted October 13, 2013 Share Posted October 13, 2013 First things first do you know what qLib is? http://qlab.github.io/qLib/ there is an environment otl that when put in scene initializes python scripts and does stuff for you Quote Link to comment Share on other sites More sharing options...
poppy Posted October 13, 2013 Author Share Posted October 13, 2013 Im afraid no. Will look into it. Thanks! Quote Link to comment Share on other sites More sharing options...
motionprojects Posted January 31, 2014 Share Posted January 31, 2014 (edited) 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 January 31, 2014 by motionprojects Quote Link to comment Share on other sites More sharing options...
NNois Posted November 15, 2015 Share Posted November 15, 2015 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.txt) is way out of my head Does a simple solution exist, telling houdini to doesn't include $JOB path in hip ? Thanks 1 Quote Link to comment Share on other sites More sharing options...
Owl Posted November 16, 2015 Share Posted November 16, 2015 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. Quote Link to comment Share on other sites More sharing options...
NNois Posted November 16, 2015 Share Posted November 16, 2015 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 Quote Link to comment Share on other sites More sharing options...
NNois Posted November 16, 2015 Share Posted November 16, 2015 ok got it workin THANKS YOU ! Quote Link to comment Share on other sites More sharing options...
NNois Posted November 19, 2015 Share Posted November 19, 2015 (edited) 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 November 19, 2015 by NNois Quote Link to comment Share on other sites More sharing options...
Owl Posted November 19, 2015 Share Posted November 19, 2015 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 1 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.