Export CLI

Hello,

I am having difficulty exporting a textured mesh using Divider3D script. The command I want to used should export an obj + textures, however it returns an error saying file not found

-exportSelectedModel %RootFolder%Models\Model_%rowNum%%columnNum%%zNum%.obj

Hi Joshua,
do you have quotes in your command?
Is this a part of a script or you added it to the script?

This is how it looks:

:: Here place any commands you would like to do with every reconstruction region (remove pause if you don’t need to work in the GUI
::pause
%RealityCaptureExe% -delegateTo * -exportSelectedModel %RootFolder%Models\Model_%rowNum%%columnNum%%zNum%.obj %RootFolder%\params.xml

Hi @Mr_Joshua_R,

When using longer paths it can be helpful to place them inside quotes since spaces and special characters can disrupt them.

Do you have a model in your project with the name mentioned in the export path? The divider script does not automatically create a model, it just separates reconstruction regions, and then a model can be created within each one of those. Since the placement of your command is in the part of a batch file where the reconstruction command can be placed, I was just wondering if a model was created beforehand.

Check if the params.xml file was made for the OBJ format.

The model is already created using divider 3d and is now 8 separate models which have been meshed and textured.

I now want to divide each model into 25 models.

Then I want to export each of those 25 models as obj.

I keep getting err:5642

Mr_Joshua_R, can you share your whole script with us?
Are you selecting the model before exporting?

:: CapturingReality

@ echo off

:: Call a batch file where variables for ReconstructionRegion .exe file and root folder are stored
call SetVariables.bat

:: Here we check how many rows and columns were used when divided, from the file table.txt
(
set /p totalRows=
set /p totalColumns=
set /p totalFloors=
)<table.txt

:: Below here place any commands you would like to do before cycling through the reconstruction regions (such as selecting a model to work with)
%RealityCaptureExe% -delegateTo *Model1

set /a rowNumber=1
set /a columnNumber=1
set /a floorNumber=1

:iteratingColumns
:: Here we load the reconstruction region
%RealityCaptureExe% -delegateTo * -setReconstructionRegion “%workingDir%reconRegions\box_%rowNumber%%columnNumber%%floorNumber%.rcbox”

:: Here place any commands you would like to do with every reconstruction region (remove pause if you don’t need to work in the GUI
::pause
%RealityCaptureExe% -delegateTo * -exportSelectedModel %RootFolder%\Models\Model_%rowNum%%columnNum%%zNum%.obj %RootFolder%\params.xml

:: Import the next reconstruction region in the row or go to the next column.
if %columnNumber% == %totalColumns% goto nextRow
set /a columnNumber+=1
goto iteratingColumns
pause

:nextRow
if %rowNumber% == %totalRows% goto nextFloor
set /a rowNumber+=1
set /a columnNumber=1
goto iteratingColumns
pause

:nextFloor
if %floorNumber% == %totalFloors% goto end
set /a floorNumber+=1
set /a rowNumber=1
set /a columnNumber=1
goto iteratingColumns

:: Finish processing.
:end

Hi,
there are some issues with your script.
%RealityCaptureExe% -delegateTo *Model1 - this doesn’t make sense, as there is no in instance named *Model1.
You need to use some command to select a wanted model in opened instance like -selectModel. Also, if you want to cut the model you will need to use -cutByBox command on selected model with actual reconstruction region
or you can use these commands there:
%RealityCaptureExe% -delegateTo * -exportSelectedModel %RootFolder%\Models\Model_%rowNum%*%columnNum%* %zNum%.obj %RootFolder%\params.xml
before -exportSelectedModel

Thank you,

I will see if this works - looking forward to a day when these things are actually a part of the software :slight_smile: