Commands Outside Command Prompt

RealityCapture enables you to run commands even without the direct use of the command line. You can do so very simply with drag-and-dropping a text file, which includes a sequence of supported commands of your choice, saved with an .rccmd extension, into the application.

Example Explained

This is an example of one command sequence that may be written inside the .rccmd file, used for loading images stored in the folder C:\MyFolder\Images\, aligning all the loaded pictures, creating a model in normal detail, and saving the project to C:\MyFolder\MyProject.rcproj:

-addFolder C:\MyFolder\Images\ -align -setReconstructionRegionAuto -calculateNormalModel -save C:\MyFolder\MyProject.rcproj

You can either write all commands in a row (like above) or write each one in a new/separate line, which helps making the code better visually structured, like this:

-addFolder C:\MyFolder\Images\
-align
-setReconstructionRegionAuto
-calculateNormalModel
-save C:\MyFolder\MyProject.rcproj

You may also use the ^ sign to break a line (with or without a space before ^):

-addFolder C:\MyFolder\Images\^
-align^
-setReconstructionRegionAuto^
-calculateNormalModel^
-save C:\MyFolder\MyProject.rcproj

NOTE: In batch scripting, you always need to break a line of code with ^ in case you want to continue the sequence of RealityCapture commands on the next line and process them as one.
Any lines beginning with #, //, REM or rem are skipped. You can use these symbols before a portion of text to mark it as a code comment, for instance: // I am a comment.

Executing commands listed in .rccmd file

You can use command execRCCMD to execute all commands listed in the specified .rccmd file. Required parameter for execRCCMD command is the full file and pathname for the .rccmd file. You can use execRCCMD command in the Windows command line, in your .bat file or inside another .rccmd file (see example below).

Passing arguments into .rccmd file

When using a command execRCCMD to execute the .rccmd file, you can pass up to 10 arguments - the first argument and path to the executed file is required. In order to use the arguments inside the .rccmd file, use $(arg0) $(arg1) ... $(arg9). Below is an example of using sample.bat file to open RealityCapture and calling addFolder.rccmd that adds images from the folder "D:\MyFolder\Images" into the application. "D:\MyFolder\Images" is the only argument passed to addFolder.rccmd.

File sample.bat file contains:

"C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe" -execRCCMD D:\MyFolder\addFolder.rccmd "D:\MyFolder\Images"

File addFolder.rccmd contains:

-addFolder $(arg1)

Using RealityCapture functions and variables

When using RealityCapture command or executing a .rccmd file, you can use basic predefined RealityCapture functions and variables. The same functions and variables can be used when exporting "Reports". You can find the instructions on how to use them as well as the list of available functions and variables, here in the section Reports - Basic functions.
Below you can find the commands inside the .rccmd. Once you drag and drop the .rccmd into the application, the following actions are performed:

  1. A new scene is opened.
  2. All inputs from folder D:\MyFolder\1 are added into the application.
  3. Inputs from the folder are aligned and a preview model is created with an automatic reconstruction region.
  4. Project is saved into D:\MyFolder\project_1.rcproj
  5. A new scene is opened.
  6. All inputs from folder D:\MyFolder\2 are added into the application.
  7. Inputs from the folder are aligned and a preview model is created with an automatic reconstruction region.
  8. Project is saved into D:\MyFolder\project_2.rcproj

Example:

$For( "i", 1, 1, 3,
-newScene
-addFolder D:\MyFolder\$(i)
-align
-setReconstructionRegionAuto
-calculatePreviewModel
-save D:\MyFolder\project_$(i).rcproj
)

NOTE: "i" comes from the right-open interval [1,3) with a step 1.

Additionally, you can use these global variables:

$(appRootDir) - path to the installation folder of the RealityCapture application. Most often it is C:\Program Files\Capturing Reality\RealityCapture.

$(appStartDir) - path to the folder from which the RealityCapture.exe was executed (e.g. the path to the .bat file that calls RealityCapture.exe).

$(cmdStartDir) - path to the folder in which the executed .rccmd file is located.

$(arg1), ..., $(arg9) - variables passed to execRCCMD command.


NOTE: Do not forget to place these variables inside quotes when using them as arguments. If spaces are present in the full path, these might be treated as separate parameters (example: -addFolder $(cmdStartDir)).

Project and Image Commands

Manage the current project, the application itself and add images via CLI

Continue

On delegating commands into an opened instance of RealityCapture

Alignment Commands

Commands for alignment and component handling

Reconstruction Commands

Model calculation via the command line

Model Tools' Commands

Further model processing via the command line

Settings' Commands

Application settings and behaviour

Error Handling Commands

Commands for handling potential errors

See also: