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?

Hey!
I ran this command:

PS C:\Program Files\Capturing Reality\RealityCapture> ./RealityCapture.exe -headless  ^ -addFolder "C:\CalculateTextured3DModel\Images" ^ -align

I don’t see anything in C:\CalculateTextured3DModel\Images nor in C:\Windows\Temp
Do I do something wrong? Also no errors or any other output in terminal.

And do you know if NVidia CUDA Toolkit is required to run RealityCapture or it’s just a tool for making it faster?

Hi Daniele, after import of the images there should be at least crmeta file. If it is not in the image folder, then it looks like the command is not ran.
Can you try to run the commands without headless mode? Or just start RC and check if it is running in the tasks?

CUDA is needed to create the normal or high detail model. It is not necessary to have for the alignment.

Hey!

I could not find the crmeta file too.

then it looks like the command is not ran.

Do you know how to get the reason behind this?

Can you try to run the commands without headless mode?

I can but there is no GUI. I tried it anyways with no results.

Or just start RC and check if it is running in the tasks?

Could you explain how to do this is terminal?

I am sorry, but I am not aware of any reasons why it doesn’t work like it should.
Are you able to run some other app using the PowerShell on that machine?

Regarding the start, I meant like run only the first part of the code (PS C:\Program Files\Capturing Reality\RealityCapture> ./RealityCapture.exe) and then use something like this Get-Process -Name "RealityCapture" to check if the app at least started.

In that case, yes. I did try to run RC itself and Get-Process did not show that RC is running. So probably RC can’t even start. Is there any way to know why RC does not run?
Does it create any logs?

I am not aware of such ways.
If RC is not started, it won’t create any logs, I suppose.

Hi Otrhan,
thanks for your reply. Is it possible to get an additional help on this topic? We run out of ideas how can we run RealityCapture in k8s.
I believe it can be an interesting use-case for you as well, since it allows better automation and orchestration of your tool.
Can we maybe schedule a call where we show what and how we are trying to use it and you or one of your technical specialists can tell us what we are doing wrong?
As far as I understood it is possible theoretically.

Thank you very much in advance,
best regards