Jump to content

rendering from the windows command line with a batch file


Recommended Posts

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

 
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 months later...

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