If the working folder is stored in the environment variable with a backslash character at the end of its path, then the variable has to be used without the backslash character immediately after it:
- Code:
set PATH=%PATH%;C:\Program Files\Capturing Reality\RealityCapture\
set MyPath=C:\MyFolder\
RealityCapture.exe -load %MyPath%PlainProject.rcproj -addFolder %MyPath%Images\ -save %MyPath%Myproject.rcproj -quit
Otherwise, a duplication of backslash character occurs and the application crashes like in this WRONG example in -load, -addFolder and -save commands:
- Code:
set PATH=%PATH%;C:\Program Files\Capturing Reality\RealityCapture\
set MyPath=C:\MyFolder\
RealityCapture.exe -load %MyPath%\PlainProject.rcproj -addFolder %MyPath%\Images\ -save %MyPath%\Myproject.rcproj -quit
I wrote myself a little program that does something similar to what you try to do here that also works with the promo version (which does of course not support CLI).
It creates a new .rcproj file from scratch and adds all png images from a specific folder to the project, then opens the project in RC.
I use it together with a batch file that extracts images from a video, creates the rcproj file and then automatically open RC with all the images already added to the project.
Here’s the rather simple VB sauce code:
- Code:
Module Module1
Sub Main()
Dim CmdArgs() As String = Environment.GetCommandLineArgs
Dim ImageDir As String = "D:\3d Scanning\" & CmdArgs(1) & "\Pictures\"
Dim ProjectDir As String = "D:\3d scanning\" & CmdArgs(1) & "\Project\"
Dim IFiles() As String = System.IO.Directory.GetFiles(ImageDir)
Dim X As Integer
FileOpen(1, ProjectDir & CmdArgs(1) & ".rcproj", OpenMode.Output, OpenAccess.Write, OpenShare.LockWrite)
PrintLine(1, "<RealityCapture version=""1.0.2.2600"">")
PrintLine(1, vbTab & "<source>")
For X = 0 To IFiles.GetUpperBound(0)
If IFiles(X).ToLower.Contains(".png") Then PrintLine(1, vbTab & vbTab & "<input fileName=""" & IFiles(X) & """/>")
Next
PrintLine(1, vbTab & "</source>")
PrintLine(1, "</RealityCapture>")
FileClose(1)
Process.Start(ProjectDir & CmdArgs(1) & ".rcproj")
End Sub
End Module