Houdini Resources

Updated on June 26  2024


Command Line Renders

Deborah R. Fowler



Command Line Rendering in Houdini


Posted on Aug 21  2018
Updated June 24  2024


In Windows

Personally, I use this method of rendering all the time.
I love command line on my home machine! Note in 19.5.303 the Command Line Tools XX.X.XX is no longer available from the start menu as it was in previous versions. It was just a shortcut to the hcmd command in the bin. You can pin the hcmd command to the start menu, but this opens with a path that is not your home directory. Easiest is to use the Houdini Launcher and under Launch select Command Line Tools

The following applies to mantra, however it also works with Redshift! Just change the rop node

If you do not have access to linux and are on windows you can command line render. I have tested the following with 18.0.287 (Apr 8 / 20), 18.5.351 during Winter quarter, 19.0.383 in (Spring 23) and 19.5.303 (Spring 24)

Method1:

Method2 (preferred with scripts below):

Your render will launch and put your results as per instructions in your mantra node.

You can also put this in a Mantra script to save typing. Here is a very straightforward implementation. Feel free to add user input such as name of file, frames etc.
Note that it is not necessary to have current1, current2, current3 - could have just used one variable name.
Modify with your filename.hipnc and the version of houdini as well as your mantra node name

MISSING IMAGE

Even better, use this with Redshift - as above but -d Redshift_ROP. Here is a Redshift example script
Modify with your filename.hipnc and the version of houdini as well as your mantra node name

I like to have a script to do multiple jobs to keep my computer busy when I am away. I call it runAway.py and place a number of these pairs of commands. That way I can queue up multiple jobs (I don't have a personal farm but running Redshift and Mantra allow me to get the most out of my resources).

os.chdir("C:/Users/Deborah/Desktop/SRCWebSite/HoudiniResources/Illusions/RubiksCubeVellum/commercial")
os.system("python runRenders.py")


In Linux

In linux you can replicate the behavior that is completed on the renderfarm. If you are having difficulties with differences or errors on the renderfarm the first thing I will ask you is if you have tested it using command line rendering. (Hint: with simulations or a heavy network you can cache geometry.)


For example in Redshift:

hrender -d Redshift_ROP_Final yourfilename.hiplc (hipnc if you use the educational or non-commercial version)


For example in mantra:
hrender -d mantra1 testSphere.hipnc

This assumes mantra1 is an output rop in the hip file.

hrender -e -f 1 3 -v -d mantra1 testSphere.hipnc

-e -f 1 3 instructs it to render frames 1 through 3
-v verbose
-d output driver

Type in hrender to see all the options (for example -o test.'$F4'.exr  added to the line above would write the information to the files if you have not specified them in your mantra node.)


Troubleshooting on the farm - render locally with command line as a first step to debugging the problem by copying the command from the log file and running it in a terminal window (with renderfarm references removed).

There are a number of ways to launch the command to test. As specified above. Or using hython or a bash script launching hython. This came up due to the linux behavior on the farm with capitalization of the extension .png or .PNG. Long story short, ensure you are using the EXACT name and capitalization when on the farm. On windows and locally on linux both .png and .PNG will work. Not so on the farm. For completeness the command are:


In the log file you will see:
For local testing that becomes simpler since we don't have to specify paths if we are in the directory of the file

OR if you want multiple frames

hrender -e -v -R -f 1 250 -o blahblah.'$F4'.exr -d mantraTest blahblah.hipnc

NOTE: Those are single quotes around $F4 not backticks (located on the key to the left of the enter key on your keyboard). Tested on vlab 3/6/2021

(Note: if you have saved geometry into a bgeo.sc file any texture material overrides will use an expanded path so you may need to have a dedicated shader for that object rather than a texture override. May 24 - I don't believe this is true anymore - will test.)


For caching command line render

hscript file.hip
cd /out
render -vA (verbose, alfred style) -I (that is an I as in interleave) nodetoprocess ... so for example it looks like
render -vA -I merge1

You can do the same thing in windows from the Houdini Command Line Tool window (it's a cmd window with the proper paths/environment set) (It is in the All Programs/Side Effects Software /Version/Utilities/Command Line Tools)