Helping a customer get around a rendering issue (the reported "black bars" problem), I wrote a simple batch file that can be used to accomplish something along these lines (rendering with intermediate MXI files). It works by calling maxwell.exe 10 separate times, each time rendering a temp MXI to a specified SL. After all 10 have been rendered, it then uses mximerge.exe to merge the intermediate MXI files, and write the output image.
It could easily be modified to render based on time, rather than SL, if that was desired. When you run the script, it prompts for the name of the MXS you want to render, the final MXI and image output names you want, and the SL to which each intermediate MXI should be rendered. It places the intermediate MXI files in a ./mxitmp directory, which you are prompted to delete prior to rendering, if it already exists.
The main problem with this approach is that it will waste time with preprocessing, since the MXS has to be loaded for each intermediate MXI. However, if you have a problem where an artifact seems to appear only after a given SL, it might be able to help you get a job out.
Code: Select all@echo off
@setlocal enabledelayedexpansion
:==============================================================================
: Find the Maxwell executables.
:==============================================================================
if not exist "%MAXWELL3_ROOT%" (
echo Could not find the MAXWELL3_ROOT directory.
pause
exit /b 1
)
set maxwell=%MAXWELL3_ROOT%\maxwell.exe
set mximerge=%MAXWELL3_ROOT%\mximerge.exe
if not exist "%maxwell%" (
echo Could not find maxwell.exe.
pause
exit /b 1
)
if not exist "%mximerge%" (
echo Could not find mximerge.exe.
pause
exit /b 1
)
:==============================================================================
: Prompt for variables used in the script.
:==============================================================================
set /p mxsinput=Enter the input MXS file name:
if x==x%mxsinput% (
echo Operation cancelled.
pause
exit /b 0
)
set /p mxioutput=Enter the output MXI file name:
if x==x%mxioutput% (
echo Operation cancelled.
pause
exit /b 0
)
set /p imgoutput=Enter the output image file name:
if x==x%imgoutput% (
echo Operation cancelled.
pause
exit /b 0
)
set /p tmpsl=Enter the desired SL for incremental MXIs:
if x==x%tmpsl% (
echo Operation cancelled.
pause
exit /b 0
)
:==============================================================================
: Check that the specified input MXS file exists.
:==============================================================================
if not exist "%mxsinput%" (
echo FAILURE: input MXS file '%mxsinput%' does not exist.
pause
exit /b 1
)
:==============================================================================
: Ask to delete existing temp MXI files and MXI/image outputs.
:==============================================================================
if exist "%mxioutput%" (
set /p ok=The MXI '%mxioutput%' already exists. Delete and continue [y/n]?
if not y==!ok! (
echo Operation cancelled.
pause
exit /b 0
)
echo Deleting %mxioutput%...
del "%mxioutput%"
)
if exist "%imgoutput%" (
set /p ok=The file '%imgoutput%' already exists. Delete and continue [y/n]?
if not y==!ok! (
echo Operation cancelled.
pause
exit /b 0
)
echo Deleting %imgoutput%...
del "%imgoutput%"
)
if exist mxitmp (
set /p ok=The mxitmp dir already exists. Delete and continue [y/n]?
if not y==!ok! (
echo Operation cancelled.
pause
exit /b 0
)
echo Deleting mxitmp dir...
rd mxitmp /s /q
)
:==============================================================================
: Create the mxitmp dir, where incremental MXIs are written.
:==============================================================================
mkdir mxitmp
if not exist mxitmp (
echo FAILURE: failed to create mxitmp dir.
pause
exit /b 1
)
:==============================================================================
: Render 10 incremental MXIs to the requested SL.
:==============================================================================
for %%i in (0 1 2 3 4 5 6 7 8 9) do (
echo Rendering mxitmp\tmp_%%i.mxi...
pushd .
call "%maxwell%"^
-mxs:"%mxsinput%"^
-mxi:"mxitmp\tmp_%%i.mxi"^
-sl:%tmpsl%^
-idcpu:%%i^
-noimage^
-nogui
popd
: Check that maxwell.exe was successful.
if not errorlevel 0 (
echo FAILURE: maxwell.exe returned an error.
pause
exit /b 1
)
)
:==============================================================================
: Call mximerge.exe to merge MXIs, and write output MXI and image.
:==============================================================================
echo Merging MXIs...
pushd .
call "%mximerge%" -folder:mxitmp -target:"%mxioutput%" -image:"%imgoutput%"
popd
: If the output MXI does not exist, mximerge.exe failed.
if not exist "%mxioutput%" (
echo FAILURE: failed to merge mxis.
pause
exit /b 1
)
: If the output image does not exist, mximerge.exe failed.
if not exist "%imgoutput%" (
echo FAILURE: failed to write output image.
pause
exit /b 1
)
:==============================================================================
: Everything was successful.
:==============================================================================
echo SUCCESS: incremental rendering successful.
pause
exit /b 0