Everything related to SDK.
By marseille13
#397330
Hello,

I'm using following script for batch and progressive renderings of a single mxs-File with several cameras/ scenes on my station:
Code: Select all
var firstSceneIndex = 1;
var lastSceneIndex = 3;
var baseName = "E_";
var inputFile = "C:\Users\Daniel\Desktop\NGS-Rework\Render-exterior\NGS-R-103-exterior.mxs";
var outputFolder = "C:\Users\Daniel\Desktop\NGS-Rework\Render-exterior\output";
var initialSL = 5;
var finalSL = 15;
var slStep = 2;
var ResX = 1469;
var ResY = 720;

var currentSL = initialSL;
var i = 0;
var isRendering = 0;
var currentSceneIndex = firstSceneIndex;

RenderEvents["renderFinished()"].connect(renderHasFinished);
Maxwell.clearConsole();

//////////////////////////////////////////////////////////////////
while( currentSL <= finalSL )
{
	currentSceneIndex = firstSceneIndex;
	renderScene();
    while( 1 )
    {
      if( isRendering == 0 )
      {
          break;
      }
    }

  currentSL += slStep;
}

//////////////////////////////////////////////////////////////////
function renderScene()
{
while (currentSceneIndex <= lastSceneIndex)
{
  renderCamera(currentSceneIndex);
  while(1)
  {
    if(isRendering == 0)
    {
        break;
    }
  }
  currentSceneIndex++;

}
} 

//////////////////////////////////////////////////////////////////
function renderCamera(frameNumber)
{
  var sceneName = baseName + frameNumber;
  Maxwell.openMxs( inputFile );
  var imagePath = outputFolder + "\" + sceneName + ".png";
  var mxiPath = outputFolder + "\" + sceneName + ".mxi";
  
  Mxi.setActiveCamera(sceneName);
  if (Mxi.activeCameraName != sceneName)
  {
    Maxwell.print("The MXS contains no camera named '" + sceneName + "'!");
  }
  else
  {
    Maxwell.print("rendering Scene: " + sceneName + " until SL " + currentSL);
	Scene.setCpuThreads(7)
    Scene.setMxiPath( mxiPath);
    Scene.setImagePath( imagePath );   
	Scene.setSamplingLevel( currentSL );
	Mxi.setResX( ResX );
	Mxi.setResY( ResY );
	Scene.setResumeRenderEnabled( true );
    isRendering = 1;
    Maxwell.startRender();
  }
}
 
//////////////////////////////////////////////////////////////////
function renderHasFinished()
{
  isRendering = 0;

  Maxwell.print( "Render finished!" );
}

now my question:
how to adapt the script so that it would work with extra sampling? I know have to configure the extra sampling parameters (Sampling Level, Custom alpha) in the mxs-File. But so far I didn't find a way that the script includes extra sampling. My script skills are too bad for that and I didn't find hints in the maxwell script documentation.

best regards
Daniel
User avatar
By Brany
#397334
To get/set the extra sampling parameters, you can use the following methods:
Code: Select all
    Scene.isExtraSamplingEnabled()
    Scene.setExtraSamplingEnabled( ... )
    Scene.extraSamplingMask()
    Scene.setExtraSamplingMask(...)
    Scene.etraSamplingSL()
    Scene.setExtraSamplingSL(...)
    Scene.extraSamplingCustomAlpha()
    Scene.setExtraSamplingCustomAlpha(...)
    Scene.extraSamplingUserBitmap()
    Scene.setExtraSamplingUserBitmap(...)
    Scene.isExtraSamplingInverted()
    Scene.setExtraSamplingInvert(...)

Hope it helps!

Yes, whenever I try to use Maxwell's fire. Regardl[…]

i7-4790 to I9-9900K

I would go with dual xeon e5-2696 v2 - around 140[…]

Forum "Registrations Closed" ?

Just noticed it says "Registrations Closed&qu[…]

ilgioma - Gallery

Hi guys, I start to insert material in my gallery […]