sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Batch Rendering with Maxwell

    Scheduled Pinned Locked Moved Extensions & Applications Discussions
    extensions
    3 Posts 2 Posters 3.3k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • peter_shawP Offline
      peter_shaw
      last edited by

      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

      // 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"?

      1 Reply Last reply Reply Quote 0
      • peter_shawP Offline
        peter_shaw
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • S Offline
          Sophien
          last edited by

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

          Thanks!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement