dchow1992 Posted October 17, 2015 Share Posted October 17, 2015 Hi there, I am working on a school project and am trying to figure out houdini's command line rendering. When I work in maya I usually write .bat files that launch maya's batch render with specified parameters. I can't get houdini's to work for some reason. SET hscriptDir="C:/Program Files/Side Effects Software/Houdini 14.0.444/bin/" cd /d %hscriptDir% SET hip_file="Z:/render_rnd.hipnc" SET rop_path=obj/ropnet1/mantra1 SET startFrame=1 SET endFrame=1 SET savePath=$HIP/render/test_$F4.exr hbatch %hip_file% render -V -f %startFrame% %endFrame% -o %savePath% %rop_path% Ideally I would like to be able to open this bat file, change the frame range / mantra node and just run it. At the moment it won't read any commands after hbatch reads my hip file which makes sense since it's an executable but is there a way to also pass my render command to hbatch? If I run the code in a command prompt line by line it works. Thanks for looking -David Quote Link to comment Share on other sites More sharing options...
Jason Posted October 17, 2015 Share Posted October 17, 2015 You need pipe in the hscript commands, something like this: echo "render -V -f %startFrame% %endFrame% -o %savePath% %rop_path%" | hbatch %hip_file% Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted October 18, 2015 Share Posted October 18, 2015 The typical way of doing this is to write out an archive for the renderer, in this case an IFD file for Mantra from the Mantra ROP. Then pass the IFD file directly to Mantra at the command line. http://www.sidefx.com/docs/houdini15.0/render/batch This is because renderer licenses are usually less expensive than full 3D package licenses. What Jason posted works too. If you use that method and if you have time later come back to it and figure out the IFD workflow too. It'll come in handy later. Quote Link to comment Share on other sites More sharing options...
dchow1992 Posted October 18, 2015 Author Share Posted October 18, 2015 okay I will try both methods out today, thanks for the knowledge guys I appreciate it Quote Link to comment Share on other sites More sharing options...
AlSk Posted March 10, 2016 Share Posted March 10, 2016 (edited) I encountered the same problem. You have to use the echo command without quotation marks. Hbatch also struggled to use the $HIP variable. Loading the files via the mread command fixed this issue. It is also very important to use forward slashes. The working .bat file looks like this: SET hbatchDir="C:\Program Files\Side Effects Software\Houdini 15.0.347\bin\" SET hipFile=c:/myProject/myHoudiniFile_1.hip SET ropPath=out/mantra1 SET startFrame=1 SET endFrame=100 CD /d %hbatchDir% (ECHO mread %hipFile% ECHO render -V -f %startFrame% %endFrame% %ropPath%) | hbatch PAUSE To render .ifd Files this .bat script works. SET hbatchDir="C:\Program Files\Side Effects Software\Houdini 15.0.347\bin\" SET folderPath=c:/myProject/ SET fileName=myIfdFile_ SET startFrame=1 SET endFrame=100 CD /d %hbatchDir% FOR /L %%A IN (%startFrame%,1,%endFrame%) DO ( mantra -f %folderPath%%fileName%%%A.ifd ) PAUSE Edited March 17, 2016 by AlSk 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.