Page 1 of 2

TUTORIAL: Using the command line options

PostPosted: Fri May 04, 2012 7:50 am
by roeland
Octane can be started from the command line, and supports command line options for loading scenes, meshes, and automated rendering.

Loading and rendering a scene.

To load an OCS scene file, give the filename as an argument: octane.exe "scene.ocs".

You can specify a mesh or a rendertarget to be rendered.
-t node : Render a rendertarget node.
-m node : Render a mesh node. You need to give the name of the mesh node, not the filename of the OBJ file (but they are often the same). If used in
combination with -t it will render this mesh instead of the mesh attached to the rendertarget.

There are two ways to load an additional OBJ mesh file:
-l file.obj : load file.obj into a new mesh node called file.obj . You can use this in combination with -m to start rendering this new node.
-r file.obj -m node : load file.obj into an existing mesh node, and render this node. This keeps the existing materials connected to this mesh node.

Some examples:

Load an OBJ file as a mesh node, and render the newly loaded mesh (using the settings in the preview render target). Since no scene file is given it will create a new scene.
octane.exe -l "mesh.obj" -m "mesh.obj"

Load a scene, and render a render target
octane.exe "scene.ocs" -t "myrendertarget"

Load a scene, load an OBJ file into an existing mesh node and render using settings from a render target
octane.exe "scene.ocs" -t "myrendertarget" -m "meshnode" -r "mesh.obj"

Changing render settings.

The rendering settings are normally taken from the selected rendertarget, or the default preview render target if only a mesh node is given. Many of
these settings can be overridden with additional options. For example -s 1000 will set the maximum amount of samples to render to 1000.
--film-width 1280 --film-height 720 changes the resolution. There are also options to change camera, daylight and exposure settings.

The output file is specified with -o for a standard PNG file. There are a few other output options, --output-exr for instance saves HDR output
to an EXR file.

Other options

Use -g 0 to render on the first GPU only. This option can be given multiple times to render on multiple GPU's.

Use -e to exit Octane after the rendering is done, and -q to suppress popup windows when loading a scene.

Run octane.exe --help for an overview of all options.

--
Roeland

Re: TUTORIAL: Using the command line options

PostPosted: Fri May 04, 2012 8:52 am
by glimpse
Thanks. I've never tried this before, but for sure i'll test it out now, 'cos it seems to be pretty useful! Just a simple QUESTION:

Let's say i have scene with 5targets. Everything is set uped & ready to render.
How to write a code so it would render target & saveout, target two & save out, etc.?

p.s. HELP file is detail enought, so i'll try to figure out myself =)

Re: TUTORIAL: Using the command line options

PostPosted: Wed May 30, 2012 12:13 pm
by AndreaMannori
So I did it:
Code: Select all
C:\Users\xxx\xxx\OctaneRender_BETA\octane.exe -e -r "Z:\project\batch_test_1.obj" -m Project_1 -q -s 128 -t "RenderTarget" -o "Z:\project\batch_test_1.png" "Z:\project\batch_test_1.ocs"
C:\Users\xxx\xxx\OctaneRender_BETA\octane.exe -e -r "Z:\project\batch_test_2.obj" -m Project_2 -q -s 128 -t "RenderTarget" -o "Z:\project\batch_test_1.png" "Z:\project\batch_test_2.ocs"
....


Pay attention to enclose all the path with "..."
Don't enclose the mesh argument with "..."
Continue adding as many lines of code as many pictures do you need
You can obviously "freeze" the render target and then change the mesh node (by changing the OBJ file)... in this way you render many different products with the same scene setup

(I found some issues with this code... first of all the -q --quite & -s --samples commands doesn't work with 2.58c)

I hope this will help you...
Cheers!

Re: TUTORIAL: Using the command line options

PostPosted: Wed May 30, 2012 12:20 pm
by matej
renderfarmsrl wrote:(I found some issues with this code... first of all the -q --quite & -s --samples commands doesn't work with 2.58c)

They work here (2.58c)

Re: TUTORIAL: Using the command line options

PostPosted: Wed May 30, 2012 12:30 pm
by AndreaMannori
Great... so, what's wrong in my code? ...octane won't accept those 2 parameters... it does continue with the original ones..

Re: TUTORIAL: Using the command line options

PostPosted: Wed May 30, 2012 6:11 pm
by matej
renderfarmsrl wrote:Great... so, what's wrong in my code? ...octane won't accept those 2 parameters... it does continue with the original ones..


ok, I only now looked at your command :)

--samples is ignored if you use -t switch (to specify a render target), this will be corrected in a future release.
--quit should work always. Try to move -q at the beginning of the command.

Re: TUTORIAL: Using the command line options

PostPosted: Wed May 30, 2012 9:04 pm
by AndreaMannori
Hi, -q stands for "quiet" ... Start Application without splash and minimized window... but it doesn't work perfectly beacause I allways see the voxeling informations etc... For future releases I hope to see octane running in background (hahaha I don't want to see anything in fact!).
Talking about -t command: I have read the specifications written by Roeland.... but if I don't use the -t command...it won't render anything because a simple window appears telling me that a syntax error occurred.
I'm not a programmer but only a geek for now so please be patient for my questions.
Thank you!

Re: TUTORIAL: Using the command line options

PostPosted: Thu May 31, 2012 12:46 pm
by matej
Yeah, -q is "quiet", I confused it with --exit.

Even if you use -q those annoying pupups still show (so it's more like --loud :)). This has been already asked to be fixed and I hope they will see to it in the next release.

-t command takes as parameter the name of the render target node you set up in your scene (the same as -o takes the name of the mesh object to render). You don't need to put names in parenthesis (atleast I don't do it here on Linux - maybe you need them if you have spaces in filenames, but spaces are bad, bad!!). I think you wrongly use the -r option in your example, you don't need that. An example without render targets (assuming all the files are in the current directory):

Code: Select all
octane.exe --exit --quiet -m test-scene.obj --samples 1024 --output-png test-scene.png test-scene.ocs

Re: TUTORIAL: Using the command line options

PostPosted: Thu May 31, 2012 10:56 pm
by roeland
You can put any argument inside quotes if you want. These two commands do the same (at least in the Windows Command Prompt and in bash):
Code: Select all
"octane.exe" "-m" "test-scene.obj" "--output-png" "test-scene.png" "test-scene.ocs"
octane.exe -m test-scene.obj --output-png test-scene.png test-scene.ocs

You need to put quotes around any paths or node names that contain spaces, and depending on your shell some other special characters.

--
Roeland

Re: TUTORIAL: Using the command line options

PostPosted: Fri Jun 01, 2012 6:51 am
by matej
@Roeland, yes that makes sense. I just never needed quotes because I never ever use spaces or special characters in filenames. It's a hassle escaping spaces when typing in the console, so I grow accustomed to write all names with underscores or hypens instead.