kgoossens Posted January 20, 2012 Share Posted January 20, 2012 (edited) Hi everybody. Sorry for the n00b question. But I'm struggling to find this. I'd like for Houdini to generate directories for the images I'm rendering. Something like what you can do in Maya <Camera>/<RenderLayer>/Filename... What kind of expression do I need or what would in need to create a folder while rendering. like $HIP/`dirCreateFunction`/image_${F4}.picnc Okay Have found my answer here Edited January 20, 2012 by kgoossens Quote Link to comment Share on other sites More sharing options...
symek Posted January 20, 2012 Share Posted January 20, 2012 (edited) The minimalist solution - highly error - prone is to wrap hscript's umkdir with expression: string mkdir(string dir) { string command = strcat("umkdir ", dir); string result = execute(command); return dir; } so that $JOB/`mkdir("images")`/test.jpg would work. Something more elaborated (possible Python call wrapped similarly), checking path, permission flags etc highly recommended. Refusing temptation of creating folders automatically is even more recommended . skk. ps Install either by Menu Edit -> Aliases & Variables -> Expressions Tab or with a line executed in 123.py exread <houdini_path>/myexpressions.cmd edit: looks like 4 years later I'm still repeating myself... Edited January 20, 2012 by SYmek Quote Link to comment Share on other sites More sharing options...
vi_rus Posted January 20, 2012 Share Posted January 20, 2012 (edited) For this purposes I wrote python script, which need set in Pre-render path of every rop node. import os curNode=hou.pwd().path() path=hou.parm(curNode+"/vm_picture").eval() fPath=path[0:path.rfind("/")] if os.path.exists(fPath)==0: os.makedirs(fPath) i=1 lParm=hou.parm(curNode+"/vm_filename_plane"+str(i)) while(lParm!=None): lPath=lParm.eval() flPath=lPath[0:lPath.rfind("/")] if (os.path.exists(flPath)==0) and (hou.parm(curNode+"/vm_disable_plane"+str(i)).eval()==0): os.makedirs(lPath[0:lPath.rfind("/")]) i+=1 lParm=hou.parm(curNode+"/vm_filename_plane"+str(i)) Edited January 20, 2012 by vi_rus 1 Quote Link to comment Share on other sites More sharing options...
inoue Posted February 20, 2012 Share Posted February 20, 2012 I write Pre-Render Script in Hscript umkdir -p `chs("vm_picture")`:h That's simple.It's my default mantra setting. If and when you use ROP Output Driver umkdir -p `chs("sopoutput")`:h I always use this. 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.