- Mon Dec 28, 2015 12:57 am
#389784
I have a sequence of MXS files (exported from RealFlow) in which vignetting is a problem. I've been trying to create a script that goes into each MXS file and sets the de-vignetting option ON with a value of 100%.
The best I've been able to do is modify the included script below which makes those changes and then renders to MXI -- but I just want the changes to be saved to the MXS file, I don't want it to render. I'm finding the documentation for scripting really difficult to follow. Any help is much appreciated.
The best I've been able to do is modify the included script below which makes those changes and then renders to MXI -- but I just want the changes to be saved to the MXS file, I don't want it to render. I'm finding the documentation for scripting really difficult to follow. Any help is much appreciated.
Code: Select all
var inputFolder = "/";
var outputFolder = "/";
var engineVersion = Maxwell.getEngineVersion();
var mxsCount = FileManager.getNumberOfFilesInBranch( inputFolder, "*.mxs" );
var mxsList = FileManager.getFilesInBranch( inputFolder, "*.mxs" );
RenderEvents["renderFinished()"].connect(renderHasFinished);
var i = 0;
var isRendering = 0;
for( i = 0; i < mxsCount; i++ )
{
renderScene();
while( 1 )
{
if( isRendering == 0 )
{
break;
}
}
}
//////////////////////////////////////////////////////////////////
function renderScene()
{
var mxsFile = mxsList[i];
var imagePath = outputFolder + "\PNG\" + FileManager.getFileName( mxsFile ) + ".png";
var mxiPath = outputFolder + "\MXI\" + FileManager.getFileName( mxsFile ) + ".mxi";
Maxwell.print( "rendering Mxs file: " + mxsFile );
Maxwell.openMxs( mxsFile );
Scene.setImagePath( imagePath );
Scene.setMxiPath( mxiPath );
Scene.setSamplingLevel( 1 );
Scene.setTime( 9999 );
Mxi.setVignettingEnabled( 1 );
Mxi.setVignetting( 100 )
isRendering = 1;
Maxwell.startRender();
}
//////////////////////////////////////////////////////////////////
function renderHasFinished()
{
isRendering = 0;
Maxwell.print( "Render finished!!" );
}
//////////////////////////////////////////////////////////////////