Command Line Interface (CLI) operations in RealityCapture
Many features of RealityCapture can be used directly via the command line or by running a script. They are passed to the application as parameters of RealityCapture.exe and executed in a sequence. The process behaves in a similar way as if the features were called using the GUI. The application will launch and you can interact with it as usual during the calculations.
You can run a command sequence in the Windows Command Prompt or by running a file with .bat extension. This is an example of the command sequence. It starts by launching the application with its full path. Every command begins with a hyphen and is followed by no, one or more parameters.
“C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe” -load C:\MyFolder\MyProject.rcproj -selectMaximalComponent -calculateNormalModel -simplify 1000000 -save C:\MyFolder\MyProject.rcproj -quit
The full application path can be replaced by a simple RealityCapture.exe - if you store the path in a system variable path.
TIP: Add the following line to the beginning of your script in order to temporarily add the RealityCapture folder to the path (until the end of the command-line session).
set PATH=%PATH%;C:\Program Files\Capturing Reality\RealityCapture
RealityCapture.exe -load … -quit
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.
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.
If you want to have a look at all of the CLI commands, please navigate to the application HELP using either the dropdown menu in the top right corner of every viewport or press F1 button and search for “All CLI Commands” topic. For other CLI related topics, search for Command Line Interface.