CLI export last model

I am writing a script to import, texture, and export a large number of objects. In CLI the export command is: -exportModel modelName fileName params.xml

My challenge is that In many cases I can’t know what the last model (e.g. is it Model2 or Model17) is in a component. As such, when I import a mesh via CLI and get a new model named ModelX to texture, I can’t predict what number “X” will be. Is there any way to export the last model in the list without knowing its name? If not, is there a way to list out all of the models so my script can find the one with the highest number in the name?

Thank you for the feature request. The requested feature is not implemented yet. I have reported your request to our management though.

Some idea:
When the project is already saved, there are written model names in the project file Project.rcproj, so there is a possibility to read them using some .xml reader or own script/program.

set PATH=%PATH%;C:\Program Files\Capturing Reality\RealityCapture\
set MyPath=X:\rc_procject_folder\

setlocal EnableDelayedExpansion
set ModelNumber=7

for %%s in (%MyPath%objects_folder*.obj) do (
set /a ModelNumber=!ModelNumber!+1
RealityCapture.exe -load %MyPath%rc_project.rcproj^
-selectMaximalComponent^
-importModel “%%s”^
-calculateTexture^
-exportModel “Model !ModelNumber!” %MyPath%done%%~nxs %MyPath%rc_project.xml^
-save %MyPath%rc_procject.rcproj^
-quit
)

this script assumes there are already 7 models in the file. adjust this number to whatever that current number is. it will add an extra number to the current models. you will need to change any paths in here to match yours.

I got the basis for this from from CR, the most trouble i had with it was getting extra spaces from copy+paste.