יום שני, 7 במרץ 2011

Maxwell MXI to PNG automation script

I've been experimenting with the console of Maxwell once and found this script to automate generation of 8 bit PNG's, it's not the best script ever but perhaps it could help someone that wants an automated
// Script start: 

// variable definitions- Zstart is the first frame, Zstop is the last frame
var Zstart = 0 ;
var Zstop = 2500 ;

//
var Znum = "000";
// Znum is a filename organizer helper 
var zi = Zstart ;
for (zi=Zstart ; zi < Zstop+1 ; zi++ )
{
if (zi < 10) {Znum = "000"};
if (zi > 9 && zi < 100) {Znum = "00"};
if (zi > 99 && zi < 1000) {Znum = "0"};
if (zi > 999 ) {Znum = ""};
var Zok = "basefilename" +Znum + zi;
var ZokFile = (Zok + ".mxi");
var ZokOut = (Zok + ".png");
Maxwell.openMxi("C:\INPUTMXIPATH\" + ZokFile );
Maxwell.saveImage("C:\OUTPUTMXIPATH\"+ ZokOut , 8);
};

// Script End
BOLD items are the ones you should edit prior to execution.

note: If you desire a Jpeg output, Please replace the ".png" with ".jpg"
comments are most welcome !Zok.

אין תגובות: