Commands Outside Command Prompt

RealityScan 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 .rscmd extension, into the application.

Example Explained

This is an example of one command sequence that may be written inside the .rscmd 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.rsproj:

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

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.rsproj

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.rsproj

NOTE: In batch scripting, you always need to break a line of code with ^ in case you want to continue the sequence of RealityScan 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 .rscmd file

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

Passing arguments into .rscmd file

When using a command execrscmd to execute the .rscmd 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 .rscmd file, use $(arg0) $(arg1) ... $(arg9). Below is an example of using sample.bat file to open RealityScan and calling addFolder.rscmd that adds images from the folder "D:\MyFolder\Images" into the application. "D:\MyFolder\Images" is the only argument passed to addFolder.rscmd.

File sample.bat file contains:

"C:\Program Files\Epic Games\RealityScan\RealityScan.exe" -execrscmd D:\MyFolder\addFolder.rscmd "D:\MyFolder\Images"

File addFolder.rscmd contains:

-addFolder $(arg1)

Using RealityScan functions and variables

When using RealityScan command or executing a .rscmd file, you can use basic predefined RealityScan 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 .rscmd. Once you drag and drop the .rscmd 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.rsproj
  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.rsproj

Example:

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

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 RealityScan application. Most often it is C:\Program Files\Epic Games\RealityScan.

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

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

$(arg1), ..., $(arg9) - variables passed to execrscmd 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 RealityScan

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: