Batch Rendering with Maxwell

Batch Rendering with Maxwell

Postby peter_shaw » Thu Dec 27, 2012 10:14 pm

Hi,
Anyone familiar with scrpiting in maxwell? especially batch rendering?

basically, i have several MXI and their corresponding MXS files in a folder. i want to improve all their SL in stages, f.ex. from 2 to 5 and then the next day from 5 to 10. (when i am AFK, so batch is important). i tried the batch_render.ms script that was included, but it doesnt seem to resume the mxi files. instead it begins from 0 at each cycle.

the included script looks like this

Code: Select all
// This script gets all the MXS files located in the folder "input" and its children
// Opens them, changes their SL and resolution and launches each render
// The output of all the images is stored in the folder "output"
// The script also shows how to handle render events
 
var inputFolder = "C:\Users\psw\Desktop\batch";
var outputFolder = "C:\Users\psw\Desktop\batch";
var engineVersion = Maxwell.getEngineVersion();
var mxsCount = FileManager.getNumberOfFilesInBranch( inputFolder, "*.mxs" );
var mxsList = FileManager.getFilesInBranch( inputFolder, "*.mxs" );
// Connect event
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 + "\" + FileManager.getFileName( mxsFile ) + ".png";
   Maxwell.print( "rendering Mxs file: " + mxsFile );
   Maxwell.openMxs( mxsFile );
   Scene.setImagePath( imagePath );
   Scene.setSamplingLevel( 3 );
   isRendering = 1;
   Maxwell.startRender();
}
 
//////////////////////////////////////////////////////////////////
function renderHasFinished()
{
   isRendering = 0;
   Maxwell.print( "Render finished!!" );
}
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


i suck at coding, maybe there is just a command like "-resume"?
0
User avatar
peter_shaw 
 

Re: Batch Rendering with Maxwell

Postby peter_shaw » Thu Dec 27, 2012 10:36 pm

ok maybe i posted too premature, i got a solution after browsing the official maxwell forums, just use the script progressive_animation.ms and set the SL steps low


/close thread
0
User avatar
peter_shaw 
 

Re: Batch Rendering with Maxwell

Postby Sophien » Fri Feb 09, 2018 12:00 pm

Hi! I want to do the same, but render in a network. Dou you knkow how is the code?

Thanks!
0

Sophien 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Extensions & Applications Discussions

Who is online

Users browsing this forum: No registered users and 4 guests

Visit our sponsors: