Hi,
I’ve encountered some problems trying sample script “Calculate a 3D textured model” on this page: RealityCapture CLI Sample Scripts - Capturing Reality
First, it seems like some functions are deprecated or modified, so I’ve updated those with functions in the “List of Command-line Commands” page in the section Help of the RC app.
So my new batch file looks like this:
:: path to RealityCapture application
set RealityCaptureExe="C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe"
:: root path to work folders where all the datasets are stored (%~dp0 means the flder in which this script is stored)
set RootFolder=%~dp0
:: variable storing path to images for creating model
set Images="%RootFolder%\Images"
:: set a new name for calculated model
set ModelName="SmallPlastic"
:: set the path, where model is going to be saved, and its name
set Model="%RootFolder%\SmallPlastic.xyz"
:: variable storing path to the project
set Project="%RootFolder%\Smallplastic.rcproj"
:: params file with the export settings
set Params="%RootFolder%\Smallplastic.xyz.rcInfo"
:: run RealityCapture
%RealityCaptureExe% -addFolder %Images% ^
-align ^
-setReconstructionRegionAuto ^
-mvs ^
-modelSelectMarginalTriangles ^
-modelRemoveSelectedTriangles ^
-renameModel %ModelName% ^
-calculateTexture ^
-save %Project% ^
-exportModel %ModelName% %Model% %Params% ^
-quit
The exportModel function requires a parameters file for the export. Based on other forum posts I exported an xyz and rcInfo file from the project with the settings I want, and passed that rcInfo file to the exportModel function as the params file. The rcInfo/params file looks like this:
<Model globalCoordinateSystem="+proj=geocent +ellps=WGS84 +no_defs" globalCoordinateSystemName="local:1 - Euclidean"
exportCoordinateSystemType="0" transformToModel="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1">
<Header magic="5786959" version="1"/>
</Model>
<ModelExport exportBinary="1" exportInfoFile="1" exportVertices="1" exportVertexColors="0"
exportVertexNormals="0" exportTriangles="1" exportTexturing="0" meshColor="4294967295"
tileType="0" exportTextureAlpha="0" exportToOneTexture="0" oneTextureMaxSide="0"
oneTextureUsePow2TexSide="0" exportCoordinateSystemType="0" settingsAnchor="0 0 0"
settingsScalex="1" settingsScaley="1" settingsScalez="1" texturesFileType="png"
formatAndVersionUID="xyz 000 " exportModelByParts="0" exportRandomPartColor="0"
exportCameras="0" exportCamerasAsModelPart="0" numberAsciiFormatting="%.20g">
<Header magic="5786949" version="1"/>
</ModelExport>
<CalibrationExportSettings undistortImagesWicFormat="{1B7CFAF4-713F-473C-BBCD-6137425FAEAF}"
undistortImagesWicPixlFormat="{6FDDC324-4E03-4BFE-B185-3D77768DC90F}"
undistortDownscaleFactor="0" undistortNamingConvention="0" undistFitMode="0"
undistResMode="0" undistPrincipalMode="0" undistCutOut="0" undistMaxPixels="0"
undistBackColor="0" undistortCustomWidth="0" undistortCustomHeight="0"
undistortCalibration="0" undistortImagesExtension="png" undistortImageNameSuffix=""
exportUndistorted="0" exportDisabled="0"/>
The script works until the exportModel command, which causes RC to crash.
Am I doing anything wrong here?
Thanks in advance!