here is a script I found in the maxwell help file, maybe It can give you the right direction.
[code]17.03.05 Progressive render for Animations
// This script renders all the MXS files located in the input folder but instead of rendering
them sequentially until each one reaches the final SL, it renders them incrementally. First
it renders all the frames up to SL 4, producing a low SL version of the whole animation
that you can use for starting post-production tasks, and then continues refining the whole
animation to SL 6, 8, 10,… in steps of 2 Sampling Levels, until the indicated final SL.
// It is useful for quickly previewing animations, and for overlapping the rendering process
with the postproduction process, saving a huge amount of time in animation projects.
// This script gets all the mxs’s located in the folder “input”
// Renders them until a desired Initial SL, to get a first version of the whole sequence, allowing the user to start the postproduction process
// Then continues refining the sequence until the Final SL, advancing in certain steps (slStep), offering continuous refinement
// Edit the following lines with your own project Input and Output folders
var inputFolder = “C:\input”;
var outputFolder = “C:\output”;
var mxsCount = FileManager.getNumberOfFilesInFolder( inputFolder, “.mxs" );
var mxsList = FileManager.getFilesInFolder( inputFolder, ".mxs” );
RenderEvents[“renderFinished()”].connect(renderHasFinished);
// The following SL values can be customized to fit your needs
var initialSL = 4;
var finalSL = 12;
var slStep = 2;
var currentSL = initialSL;
var i = 0;
var isRendering = 0;
while( currentSL <= finalSL )
{
for( i = 0; i < mxsCount; i++ )
{
renderScene();
while( 1 )
{
if( isRendering == 0 )
{
break;
}
}
}
currentSL += slStep;
}
//////////////////////////////////////////////////////////////////
function renderScene()
{
var mxsFile = mxsList[i];
var imagePath = outputFolder + “” + FileManager.getFileName( mxsFile ) + “.png”;
var mxiPath = outputFolder + “” + FileManager.getFileName( mxsFile ) + “.mxi”;
Maxwell.print( "rendering Mxs file: " + mxsFile );
Maxwell.openMxs( mxsFile );
Scene.setImagePath( imagePath );
Scene.setMxiPath( mxiPath );
Scene.setSamplingLevel( currentSL );
// Uncomment the following lines if you want to set a different resolution than the indicated in the MXS scene file
// Scene.setResX( 400 );
// Scene.setResY( 400 );
Scene.setResumeRenderEnabled( true );
isRendering = 1;
Maxwell.startRender();
}
//////////////////////////////////////////////////////////////////
function renderHasFinished()
{
isRendering = 0;
Maxwell.print( “Render finished!!” );
}
//////////////////////////////////////////////////////////////////[/code]
-SeB-