Run RealityCapture.exe in powershell

Hello everyone!

I’m trying to run RealityCapture.exe via PowerShell on a Windows machine connected through SSH. I’ve written the following script:

./RealityCapture.exe -headless -activate "TOKEN" -addFolder "C:\CalculateTextured3DModel\Images"  -align -setReconstructionRegionAuto  -calculateNormalModel -selectMarginalTriangles -removeSelectedTriangles -renameSelectedModel "SmallPlastic"   -calculateTexture  -save "C:\CalculateTextured3DModel\Smallplastic.rcproj" -exportModel "SmallPlastic" "C:\CalculateTextured3DModel\SmallPlastic.obj" -quit

When I execute this, the terminal returns immediately with no feedback. I don’t see any logs, and I’m unsure where RealityCapture might store log files.
Please help.

Hello, the script looks good. Are you launching the script from the following directory?

C:\Program Files\Capturing Reality\RealityCapture>

You have to either be in this directory to launch RealityCapture or you have to add this directory to the system PATH.

To your other question, the RealityCapture log file is being stored to:

C:\Users\%USERNAME%\AppData\Local\Temp\RealityCapture.log

Hallo Jakub!
Yes, I run the script from C:\Program Files\Capturing Reality\RealityCapture>

Unfortunately there are no logs in C:\Users%USERNAME%\AppData\Local\Temp\RealityCapture.log

Hi Daniele, can you check if you have set it properly: https://dev.epicgames.com/community/learning/knowledge-base/jwOO/capturing-reality-files-stored-by-realitycapture#:~:text=set%20to%20Yes.-,RealityCapture%20log%20file,-The%20log%20file ?

Also, to monitor your processes you can use -writeProgress command.

Hey!
Unfortunately -writeProgress did not show anything. Is it even possible to run RC in Windows container? Do you know the cases where users did that?

Just to clarify, what do you expect as log file?
How was code using -writeProgress written? The created file should look like this: RealityCapture Help
If you wish just to view the console view of the process, you can use it like this:
-stdConsole >> "C:\Documents\Testing\console_report.txt" ^

I am not aware of such usage. But it is possible to run it on virtual machines.

To be honest anything. When I run RC I get nothing at all. No error message, there are no logs anywhere, no error code. The terminal returns immediately which shows me that something is wrong.
Usually it takes at least few minutes to finish.

./RealityCapture.exe -headless -activate "CODE" -writeProgress "C:\CalculateTextured3DModel\log" -addFolder "C:\CalculateTextured3DModel\Images"         -align         -setReconstructionRegionAuto         -calculateNormalModel         -selectMarginalTriangles         -removeSelectedTriangles         -renameSelectedModel "SmallPlastic"         -calculateTexture         -save "C:\CalculateTextured3DModel\Smallplastic.rcproj"         -exportModel "SmallPlastic" "C:\CalculateTextured3DModel\SmallPlastic.obj"         -quit

The -stdConsole >> "C:\Documents\Testing\console_report.txt" ^ just created an empty file

Is this the direct copy of your script? If so, I copied that to Notepad++ and there are unnecessary spaces.

It seems like your script doesn’t run at all (as you are getting empty files). Can you try to add “^” sign after each of your command?
Also, just to check the script, run it not as headless (unless until it will run properly).

Which version of RealityCapture are you using? If it is up to 1.4, you don’t need to use -activate command.

In -writeProgress command you are missing the file name (-writeProgress “C:\CalculateTextured3DModel\log\log.txt”).

there are unnecessary spaces

I don’t think this is the source of my problem

Can you try to add “^” sign after each of your command?

I tried and still nothing

run it not as headless

I run this in container and it does not have GUI, but I still tried it and it did not work.
By the way I use the sample script from RC documentation: RealityCapture CLI Sample Scripts - Capturing Reality
" Calculate a 3D textured model"

In -writeProgress command you are missing the file name (-writeProgress “C:\CalculateTextured3DModel\log\log.txt”).

I think I used “C:\CalculateTextured3DModel\log”
I tried it and still nothing :frowning:

It could be a problem, as spaces may be considered as ending sign (I know this is not an exact explanation).

Have you added ^ and removed the spaces? How the script (a whole) looks now?

Can you try to test your script not in container at first (to see the process and if it is working for you)?

I suppose you also modified the script, as it looks slightly different.

But maybe the spaces are not a such big issue. I tested the script, but I slightly changed it and it worked in Powershell for me as:
./RealityCapture.exe -headless -writeProgress "C:\Documents\Testing\Outputs\CLI\log_progress.txt" -addFolder "C:\CalculateTextured3DModel\Images" -align -setReconstructionRegionAuto -calculateNormalModel -selectMarginalTriangles -removeSelectedTriangles -renameSelectedModel "SmallPlastic" -calculateTexture -save "C:\CalculateTextured3DModel\Smallplastic.rcproj" -exportModel "SmallPlastic" "C:\CalculateTextured3DModel\SmallPlastic.obj" -quit

Hey, thanks for your support

The script looks like this at the moment:

./RealityCapture.exe  -activate "CODE" ^ -writeProgress "C:\CalculateTextured3DModel\console_report.txt" ^ -addFolder "C:\CalculateTextured3DModel\Images" ^ -align ^ -setReconstructionRegionAuto ^ -calculateNormalModel ^ -selectMarginalTriangles ^ -removeSelectedTriangles ^ -renameSelectedModel "SmallPlastic" ^ -calculateTexture ^ -save "C:\CalculateTextured3DModel\Smallplastic.rcproj" ^ -exportModel "SmallPlastic" "C:\CalculateTextured3DModel\SmallPlastic.obj" ^ -quit

Can you try to test your script not in container at first (to see the process and if it is working for you)?

Yes, of course. I tested the script on bare metal machine before trying to put it into container. It worked.

And just fyi, I use mcr.microsoft.com/powershell:latest image for this. I installed RC using RealityCapture-1.4.1.117425.msi.
I don’t even know how to test that RC is installed successfully. There are files in C:\Program Files\Capturing Reality\RealityCapture>, but since the RC cli does not provide any debugging commands like --version, --status or --help we can’t make sure that it’s installed properly.

As you are using 1.4.1 version, it is not necessary to have the -activate command. But I suppose it is not a deal, as it works like it is.
As you have the mentioned folder I suppose that RealityCapture was installed there. Can you run just a simple script with just -align command and check the temp files, if there will be something changed?