Page 1 of 1
Scripting help
Posted: Fri May 20, 2011 7:33 am
by florianpiento
hi,
how can I modify the progressive animation script with the diverse functions provided in the Maxwell Manual Scripting References ?
for example where should I add and how to use the void setTime( int value ); if I would like to change the maximum time render of all the mxs to be rendered ?
or where should I add and how to use the flag -hide to hide the console and display while processing ?
thank you
Re: Scripting help
Posted: Fri May 20, 2011 11:56 am
by Bubbaloo
Not really an answer to your question, but have you used the network wizard with animation? It can be used with only one computer running node, manager, and monitor.
Re: Scripting help
Posted: Fri May 20, 2011 12:40 pm
by Mihai
florianpiento wrote:
for example where should I add and how to use the void setTime( int value ); if I would like to change the maximum time render of all the mxs to be rendered ?
I don't think you can use time instead of SL because the resuming checks if the SL you set is higher than the one currently in the MXI. But this shouldn't be a problem because you just want to see a quick result of the animation to start the compositing and it's at about SL 4-5 you get a clear enough image to start with, no matter the scene. If you just set 5 min for a complex interior scene, it probably won't reach even SL 1 in that time so it's not of much use.
or where should I add and how to use the flag -hide to hide the console and display while processing ?
You can do this by running command line instead, you can load a script with the -script flag, and -nogui or -hide.
Re: Scripting help
Posted: Sat May 21, 2011 3:02 am
by florianpiento
Bubbaloo wrote:Not really an answer to your question, but have you used the network wizard with animation?
Since I work only on one computer I haven't thought about this solution. I'll check it out. thanks !
Mihai wrote:I don't think you can use time instead of SL because the resuming checks if the SL you set is higher than the one currently in the MXI.
I'm rendering a sequence with the progressive animation script. step = 2 target SL = 18. when maxwell launch an mxs to render it the time limit is 2h00 (probably the time limit I set in my original maya file). at the beginning there is no problem because the step of 2SL is reached before the time is up. but when it gets to higher SL, time elapses before the step is done, which means it will have to open/close the mxs sequence more than necessary. is there a way to fix this ?
Mihai wrote:You can do this by running command line instead, you can load a script with the -script flag, and -nogui or -hide.
Where in the progressive animation script can I paste the -nogui or -hide flag ? Maxwell Script debugger is telling me "can't find variable: nogui" whereever I paste it.
// 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;
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 );
-nogui; ???
isRendering = 1;
Maxwell.startRender();
}
//////////////////////////////////////////////////////////////////
function renderHasFinished()
{
isRendering = 0;
Maxwell.print( "Render finished!!" );
}
//////////////////////////////////////////////////////////////////
Re: Scripting help
Posted: Sat May 21, 2011 4:07 am
by Mihai
I ment open a command prompt and just specify the path to your script there, adding the -hide flag as well. Look in the manual to learn about starting a render via the command line.
About the time, I guess try and set a higher time in your original file, like 9999 minutes.
Re: Scripting help
Posted: Sat May 21, 2011 5:33 am
by florianpiento
thanks, I'll try that.
Re: Scripting help
Posted: Sat May 21, 2011 2:49 pm
by Aji Enrico
If you want to override the scene file rendering time values from within the script, you can edit the script by
Just below:
Code: Select allScene.setSamplingLevel( currentSL );
you can add the line:
Re: Scripting help
Posted: Sat May 28, 2011 1:47 am
by florianpiento
Thanks ! It works perfectly now !