All posts related to V2
By florianpiento
#342935
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
User avatar
By Mihai
#342949
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.
By florianpiento
#342970
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!!" );
}

//////////////////////////////////////////////////////////////////
User avatar
By Mihai
#342971
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.
By Aji Enrico
#342981
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 all
Scene.setSamplingLevel( currentSL );
you can add the line:
Code: Select all
Scene.setTime(9999);
Help with swimming pool water

I think you posted a while back that its best to u[…]

Sketchup 2026 Released

Considering how long a version for Sketchup 2025 t[…]

Greetings, One of my users with Sketchup 2025 (25[…]

Maxwell Rhino 5.2.6.8 plugin with macOS Tahoe 26

Good morning everyone, I’d like to know if t[…]