Difference between revisions of "Windows Command Line Reference (TG4)"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Created page with "This document is a mirror of the file 'win_command_line.txt' in the Docs folder in the Terragen 4 folder. Updated 30/January/2017 (build 4.0.11) --------------------------...")
 
 
Line 1: Line 1:
 
This document is a mirror of the file 'win_command_line.txt' in the Docs folder in the Terragen 4 folder.
 
This document is a mirror of the file 'win_command_line.txt' in the Docs folder in the Terragen 4 folder.
 
  
 
Updated 30/January/2017 (build 4.0.11)
 
Updated 30/January/2017 (build 4.0.11)
Line 8: Line 7:
 
Running Terragen 4 From a Command Line or Shell environment
 
Running Terragen 4 From a Command Line or Shell environment
 
-----------------------------------------------------------
 
-----------------------------------------------------------
 +
  
 
Two executables are provided with TG4:
 
Two executables are provided with TG4:
Line 142: Line 142:
 
may result in:
 
may result in:
  
'C:\frames\image.0023.tgAlpha.exr'
+
'C:\frames\image.0023.tgAlpha.exr'<br/>
'C:\frames\image.0023.tgSurfRgb.exr'
+
'C:\frames\image.0023.tgSurfRgb.exr'<br/>
'C:\frames\image.0023.tgSurfAlpha.exr'
+
'C:\frames\image.0023.tgSurfAlpha.exr'<br/>
 
etc.
 
etc.
  
 
or, if "create subfolders" option is enabled (in project or command line), may result in:
 
or, if "create subfolders" option is enabled (in project or command line), may result in:
  
'C:\frames\tgAlpha\image.0023.tgAlpha.exr'
+
'C:\frames\tgAlpha\image.0023.tgAlpha.exr'<br/>
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'
+
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'<br/>
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'
+
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'<br/>
 
etc.
 
etc.
  
Line 175: Line 175:
 
may result in:
 
may result in:
  
'C:\frames\tgAlpha\image.0023.exr'
+
'C:\frames\tgAlpha\image.0023.exr'<br/>
'C:\frames\tgSurfRgb\image.0023.exr'
+
'C:\frames\tgSurfRgb\image.0023.exr'<br/>
'C:\frames\tgSurfAlpha\image.0023.exr'
+
'C:\frames\tgSurfAlpha\image.0023.exr'<br/>
 
etc.
 
etc.
  
Line 183: Line 183:
 
It can be combined with the use of "IMAGETYPE" in the filename, so the following is possible:
 
It can be combined with the use of "IMAGETYPE" in the filename, so the following is possible:
  
'C:\frames\tgAlpha\image.0023.tgAlpha.exr'
+
'C:\frames\tgAlpha\image.0023.tgAlpha.exr'<br/>
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'
+
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'<br/>
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'
+
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'<br/>
 
etc.
 
etc.
  

Latest revision as of 21:57, 13 March 2019

This document is a mirror of the file 'win_command_line.txt' in the Docs folder in the Terragen 4 folder.

Updated 30/January/2017 (build 4.0.11)



Running Terragen 4 From a Command Line or Shell environment



Two executables are provided with TG4:

tgd.exe: Does not print anything to the console. Returns to the command prompt immediately while continuing to run in the background.

tgdcli.exe: Exactly the same as tgd.exe, except that it prints messages and warnings to the console and it only returns to the command prompt after execution has finished.

Both executables can be run either with or without a GUI, and both share the same command line options.


SETUP


tgd or tgdcli can be launched from the command line in a number of different modes. However, before you try running them from the command line it's wise to set up some environment variables.

If Terragen is not in the current working directory, it will probably make lots of complaints when it starts. It's not enough just to pass the full path of the tgdcli command when you run it. Terragen needs to know where it can find other related files.

To fix this, you can set the TERRAGEN_PATH environment variable. For example, on the Windows command line or batch file:

   set TERRAGEN_PATH=C:\Program Files\Planetside Software\Terragen 4

In other shells you would use the appropriate syntax (such as setenv).

IMPORTANT: If you set the TERRAGEN_PATH variable you modify the behaviour of all instances of Terragen within the scope of the variable, and this may cause problems if you have multiple versions installed. You can avoid using the TERRAGEN_PATH variable if you 'cd' to the directory before calling the executable.


EXECUTION


Once the environment variable is set, you can run Terragen. Here are some examples at the Windows command prompt or in a batch file. In other shells you would probably replace %TERRAGEN_PATH% with $TERRAGEN_PATH.

Quotes are used to surround the executable path, because TERRAGEN_PATH may contains spaces.


Run Terragen as normal:

   "%TERRAGEN_PATH%/tgdcli"

Run Terragen and load a project file:

   "%TERRAGEN_PATH%/tgdcli" -p myproject.tgd

Run Terragen without the GUI, render frame 42, then close:

   "%TERRAGEN_PATH%/tgdcli" -p myproject.tgd -hide -exit -r -f 42

Run Terragen without the GUI, render frames 1,4,51,53,55,57,59, then close:

   "%TERRAGEN_PATH%/tgdcli" -p myproject.tgd -hide -exit -r -f 1,4,51-60/2


IMPORTANT: Currently Terragen automatically sets the -hide and -exit flags whenever -r is set, but you should always set -hide and -exit if you don't want this behaviour to change in future versions.


ALL COMMAND LINE OPTIONS



-exit

Exit Terragen after rendering has finished. Do not show any dialog boxes (because they may prevent exiting).


-f <frameRange|commaSeparatedFrameRanges>

Set the frame range or list of frame ranges to render when -r is also used. If -r is not used, the current frame is set to the first in the range. The list can contain any combination of frames or frame ranges separated by commas without any whitespace.


Example: -f 34

Set the frame to render to 34.


Example: -f 1-100

Set the frame range to render from 1 to 100 (inclusive).


Example: -f 1-100/5

Set the frame range to render from 1 to 100 with a step size of 5. This produces the sequence 1, 6, 11, 16, ... , 96. Note that frame 100 is not rendered because 96 + 5 = 101 which is outside the specified range.


Example: -f 34,37,38

Set the list of frames to render to 34, 37, 38


Example: -f 1-50,66,71-100/10

Set the list of frames to render from 1 to 50 (inclusive) followed by 66 followed by 71, 81, 91. Note that frame 100 is not rendered because 91 + 10 = 101 which is outside the specified range.


-hide

Hide the graphical user interface. Do not show any dialog boxes.


-no3dpreview

Do not open the 3D Preview automatically.


-nonetworkview

Do not open the Network View automatically (except in Node Network Layout).


-o <filename>

Set the renderer's output image filename to <filename> before rendering. C-style format strings can be used to automatically insert the frame number, eg. 'C:\frames\image.%04d.IMAGETYPE.exr' Supported image extensions are .bmp, .rgb, .sgi, .exr, .tif, .tiff


-ox <filename>

Set the renderer's "extra output images" filename to <filename> before rendering. Extra output images should contain the string "IMAGETYPE" (not including quotes). When a render element is written, "IMAGETYPE" is automatically replaced by the name of the element. By default the only element is "tgAlpha", but additional elements can be enabled using a Render Layer.


For example:

'C:\frames\image.0023.IMAGETYPE.exr'

may result in:

'C:\frames\image.0023.tgAlpha.exr'
'C:\frames\image.0023.tgSurfRgb.exr'
'C:\frames\image.0023.tgSurfAlpha.exr'
etc.

or, if "create subfolders" option is enabled (in project or command line), may result in:

'C:\frames\tgAlpha\image.0023.tgAlpha.exr'
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'
etc.


C-style format strings can be used to automatically insert the frame number. Example:

'C:\frames\image.%04d.IMAGETYPE.exr'


Supported image extensions are .bmp, .rgb, .sgi, .exr, .tif, .tiff


-oxsubfolders

Create and use subfolders when outputting render elements (extra output images). This overrides the "create subfolders" option in the project's render node.


For example:

'C:\frames\image.0023.exr'

may result in:

'C:\frames\tgAlpha\image.0023.exr'
'C:\frames\tgSurfRgb\image.0023.exr'
'C:\frames\tgSurfAlpha\image.0023.exr'
etc.


It can be combined with the use of "IMAGETYPE" in the filename, so the following is possible:

'C:\frames\tgAlpha\image.0023.tgAlpha.exr'
'C:\frames\tgSurfRgb\image.0023.tgSurfRgb.exr'
'C:\frames\tgSurfAlpha\image.0023.tgSurfAlpha.exr'
etc.


If the command line contains both -oxsubfolders and -oxsubfolders=no then the behaviour is undefined.


-oxsubfolders=no

Prevent the creation or use of subfolders when outputting render elements (extra output images). This overrides the "create subfolders" option in the project's render node, which is usually enabled. If the command line contains both -oxsubfolders and -oxsubfolders=no then the behaviour is undefined.


-p <filename>

Open the project specified by <filename> before doing anything else.


-r

Render current frame (or frame range with -f) using the "master" renderer; save output image and extra output images (if enabled). The -hide and -exit flags are set automatically in the current version. The "master" renderer is the render node which has its "master" setting enabled, or the first render node in the project if none are masters. Another render node can be made the "master" by using the -rendernode command line option.


-rendernode <nodename>

Make <nodename> the "master" renderer after autoloading the project at startup. <nodename> must be the name of a render node in the project. Projects loaded subsequently are not affected.


-threads <numberOfThreads>

Override the number of threads used for rendering and other multithreaded tasks. When used, this command line override takes priority over the min/max thread settings in the render node and the cores override in Preferences.


-tilex <minx> <maxx>

Limit the rendered region to a fraction of the image or crop region to be rendered. minx and maxx should be numbers between 0 and 1, where minx < maxx. For example, "-tilex 0 0.5" renders only the left half of the image or the left half of whatever crop region was already set. You can use both -tilex and -tiley simultaneously to define a rectangular region.


-tiley <miny> <maxy>

Limit the rendered region to a fraction of the image or crop region to be rendered. miny and maxy should be numbers between 0 and 1, where miny < maxy. For example, "-tiley 0 0.5" renders only the bottom half of the image or the bottom half of whatever crop region was already set. You can use both -tilex and -tiley simultaneously to define a rectangular region.


-cropoutput

Crop the output image(s) to the dimensions of the rendered region (defined by "crop region" and/or -tilex, -tiley), i.e. do not pad to the full image dimensions.


-w <filename>

The same as the -p option

Graphical User Interface, a general term that refers to the interface of any program running in a modern graphical operating system and which does not operate exclusively from the commandline.

A single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene.