Updated!! BATCH RENDER Script Is Here! Download It. Test It. Share It

iEmby wrote on 9/19/2023, 2:30 PM

Hey VEGAS Pro Users. This is iEmby. Using Vegas from VP13 Version.

Have A YouTube Channel for VEGAS Pro Only.

https://www.youtube.com/@editroom1580 (PLEASE SUBSCRIBE AND SUPPORT)

 

Today I updated this BATCH RENDER script with the help of ChatGPT and a little common sense.

What I Able to Improve in This Script:

  • Modern Icon & Improved Interface
  • For VEGAS Pro 15 And Next Versions.
  • Will Render Project, Selection, Regions (Default Feature)
  • Will Render Regions by Using Regine Label as File Names.
  • If No Region Label Is Existing. It Will Render by Naming Regions As 'Region-1' 'Region-2' ------- Onwards.
  • Will Ask You for Crosscheck Rendering Information like Template, Rendering Mode, Duration and Selection Range and Output File Name.
  • Will Not Work on Unsaved Fresh Project. It will Ask to Save Project First with Save Button. After saving project, script will run automatically.
  • If You Was Not Willing to Save Project, You Can Press NO. It Will Save Project in a Temporary Projects Folder at Desktop.
  • Will Keep All Renders in a Folder Named 'Renders' At the Same Location Where Project Is Saved. (This Folder Will Be Automatically Created)
  • Will Render Output File in Project and Selection Mode with Same Name as Project Name Is.
  • Will Save a Backup File of The Project Before Start Rendering, in a Folder Named 'Backups' which will be automatically created if not exists.
  • If file is already existed, then it will give you options 'Overwrite' and 'Keep Both'. if 'Keep Both' selected then it will give it a name i.e. Existing File Name + count number starting from 1 in an incremented counter manner.

So, Download It. Share Your Thoughts on This. Enjoy.

https://drive.google.com/drive/folders/1ft0rZpcBhGatTw5sc2t18z0ACQAXWsu_?usp=sharing

Note: Paste Both Files Into 'Script Menu' In Your VEGAS Pro's Program Directory.

Last changed by iEmby

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Comments

iEmby wrote on 9/19/2023, 11:03 PM

@lan-mLMC

you have to import all your .veg files in a new Vegas Project. Then create region on every veg. file. Give them names if you want.

Then render them by using this script in Region Mode.

that's it

Last changed by iEmby on 10/1/2023, 9:59 PM, changed a total of 1 times.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

iEmby wrote on 9/20/2023, 6:52 PM

updated with more coding.. check my description.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

sean-nelson wrote on 9/26/2023, 10:17 AM

Great job! If I wanted to have the project name at the beginning and the export template name at the end of the output file. How would I do that? Example: Project_RegionName_Template Name

iEmby wrote on 11/26/2023, 2:36 AM

you have to add some more codes in this script. take help of Chat GPT

 

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

iEmby wrote on 11/26/2023, 3:03 PM

one more plus point updated

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

jetdv wrote on 11/27/2023, 1:41 PM

@iEmby, I ran it in VEGAS Pro 21 and it seems to run fine. I don't typically do batch renders of any sort, though. I edit a project and render the project to the one output format I want. Then start on the next project. But it appears to work fine and options were grayed out when I didn't have regions or a selection set.

iEmby wrote on 11/28/2023, 12:16 PM

@iEmby, I ran it in VEGAS Pro 21 and it seems to run fine. I don't typically do batch renders of any sort, though. I edit a project and render the project to the one output format I want. Then start on the next project. But it appears to work fine and options were grayed out when I didn't have regions or a selection set.

sir selection option and region option is grayed out bcoz you will don't have loop region selection for render or regions for render so in this case only project can be render which mean whole timeline.

so if u want to render selection then select loop region to what you want to render and add regions if you want different selections renders.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Javadarsena wrote on 11/28/2023, 12:37 PM
...

You are the f****** god !!!!!!!!Amazing !! tks

jetdv wrote on 11/28/2023, 1:42 PM

sir selection option and region option is grayed out bcoz you will don't have loop region selection for render or regions for render so in this case only project can be render which mean whole timeline.

@iEmby Yes, I understand that which is why I said they were properly grayed out when there was none. In other words, I said it appears to be working correctly.

iEmby wrote on 4/28/2024, 11:01 AM

Does it support render queues for multiple .veg?

No sir... may be i can add that thing in this in future.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

jetdv wrote on 4/28/2024, 12:03 PM

Does it support render queues for multiple .veg?

No sir... may be i can add that thing in this in future.

lan-mLMC wrote on 4/28/2024, 9:04 PM

Does it support render queues for multiple .veg?

No sir... may be i can add that thing in this in future.

In addition to the tutorial of jetDv, here is a script that may be of reference value to your development.
https://drive.google.com/file/d/0B0bNEG_bEepqT0pRTDdETy1BaHM/view?usp=sharing&resourcekey=0-8zJKdtKmBUKtYCjuSrStCw

Vegasaur's multi-project rendering queue may also be of reference value to you.
https://vegasaur.com/transcoder

iEmby wrote on 4/30/2024, 12:39 AM

@lan-mLMC

yeah i am planning to create it from new interface with more functions.

actually i take help of mostly ChatGPT.
but this will be more help full for me so i will consider @jetdv and your suggestions for this purpose.

 

and your drive link is asking for access request.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

lan-mLMC wrote on 4/30/2024, 12:55 AM

and your drive link is asking for access request.

Its content is:
 

/**
 * Sonic Foundry initially wrote this script to render 1 file in
 * several different formats using render templates.
 *
 * I have modified the script to accept many different veg files and
 * render them in many different formats.
 *
 * Feel free to make any modifications and/or improvements to this script.
 * If you make it better, please share it with others.
 *
 * At the bottom of the GUI there is a check box.  If that box is checked
 * when OK is clicked, the current information is added to the queue and
 * the window reopens to allow the user to add an additional file with render
 * settings to the queue.  When you add the last file to the queue, just make
 * sure that check box is unchecked.  The batch rendering will then begin.
 *
 * Author: Steven Christy
 * e-mail: n5zq@arrl.net
 *
 * Revision Date: Feb. 20, 2003.
 * Updated 2nd January 2017 to run on Vegas 14 for Magix Zulqar Cheema
 **/
import System;
import System.Collections;
import System.Text;
import System.IO;
import System.Drawing;
import System.Windows.Forms;
import ScriptPortal.Vegas;

// set this to true if you want to allow files to be overwritten
var overwriteExistingFiles = true;


try {

// here are some default variables for the GUI.
    var defaultBasePath : String = Vegas.Project.FilePath;
    if ((null == defaultBasePath) || (0 == defaultBasePath.length)) {
        var vegFile = "Untitled.veg";
        defaultBasePath = "Untitled_";
    } else {
        var dir = Path.GetDirectoryName(defaultBasePath);
        var fileName = Path.GetFileNameWithoutExtension(defaultBasePath);
        var vegFile = dir + "\\" + fileName + ".veg";
        defaultBasePath = dir + "\\" + fileName + "_";
        
    }
 
      // Constants used to help identify elements of
      // the multi-dimensional array
    const projectFile = 1;
    const outputFilePath = 2;
    const renderMode = 3;
    const selectedTemplates = 4;
    
      // Declare the array
    var arrayOfVars = new Array();
      // Variable to keep track of the number of files added to the queue
    var numFiles = 1;
    
    // Create varible to display GUI dialog and
    // keep track of its variables
    var dlog = new BatchRenderDialog();

    // If dialog box runs OK we will add the first set of variables to the first
    // element of the multi-dimensional array
    if (DialogResult.OK == dlog.ShowDialog()) {
        arrayOfVars[numFiles] = new Array(4);
        arrayOfVars[numFiles][selectedTemplates] = dlog.GetCheckedTemplates();
        
        // inform the user of some special failure cases
        if (0 == arrayOfVars[numFiles][selectedTemplates].Count && dlog.addAnother.Checked)
           throw "no render templates selected";
        arrayOfVars[numFiles][projectFile] = dlog.openFileName.Text;
        arrayOfVars[numFiles][outputFilePath] = dlog.fileNameBox.Text;
        arrayOfVars[numFiles][renderMode] = RenderMode.Project;
        
        // if render mode is chosen we need to set the variable appropriately
        if (dlog.renderRegions.Checked) {
            arrayOfVars[numFiles][renderMode] = RenderMode.Regions;
        }
        
        // if the check box that controls whether we need to add another file
        // to the queue is checked, we clear the dialog variable and display
        // the dialog again.  This will happen until OK is pressed without the
        // check box being checked
        while (dlog.addAnother.Checked) {
            dlog = new BatchRenderDialog();
               if (DialogResult.OK == dlog.ShowDialog()) {
                  numFiles = numFiles + 1;
                arrayOfVars[numFiles] = new Array(4);
                arrayOfVars[numFiles][selectedTemplates] = dlog.GetCheckedTemplates();
            // inform the user of some special failure cases
                if (0 == arrayOfVars[numFiles][selectedTemplates].Count && dlog.addAnother.Checked)
                       throw "no render templates selected";
                   
                   // We need to make sure that a template is selected before we populate
                  // all of the variables.  Otherwise we need to decrement the number of
                  // files and forget we ever displayed the box again
                  if (0 != arrayOfVars[numFiles][selectedTemplates].Count) {
                    arrayOfVars[numFiles][projectFile] = dlog.openFileName.Text;
                    arrayOfVars[numFiles][outputFilePath] = dlog.fileNameBox.Text;
                    arrayOfVars[numFiles][renderMode] = RenderMode.Project;
                    if (dlog.renderRegions.Checked) {
                        arrayOfVars[numFiles][renderMode] = RenderMode.Regions;
                    }
                } else {
                        numFiles = numFiles - 1;
                  }
            }
        }
        
        // We declare and initialize our loop control variable.  It will help us control how many times
        // we need to call the batch render function
        var i = 1;
        while (i <= numFiles) {
            // The batch render function handles all of the functions of rendering.  This includes
            // rendering each of the files with multiple templates, if chosen.
            DoBatchRender(arrayOfVars[i][selectedTemplates], arrayOfVars[i][outputFilePath], arrayOfVars[i][renderMode], arrayOfVars[i][projectFile]);
            i++;
        }
        
    }
    
} catch (e) {
    if (!e.skipMessageBox)
        MessageBox.Show(e);
}

enum RenderMode {
    Project = 0,
    Selection,
    Regions,
}

function DoBatchRender(selectedTemplates : ArrayList,
                       basePath : String,
                       renderMode : RenderMode,
                       projFile : String)
{
    var outputDirectory = Path.GetDirectoryName(basePath);
    var baseFileName = Path.GetFileName(basePath);
 
    // We need to open the Vegas project file to be rendered.
    Vegas.OpenProject(projFile);

    // make sure the output directory exists
    if (!Directory.Exists(outputDirectory))
    {
        var msg = new StringBuilder("The output directory (");
        msg.Append(outputDirectory);
        msg.Append(") does not exist.\n");
        msg.Append("Please specify directory and base file name using the Browse button.");
        throw msg;
    }

    var zero : int = 0;
    var zeroTime = new Timecode();
    var renderStart, renderLength;

    var templateFound = false;

    // enumerate through each selected render template
    var selections = new Enumerator(selectedTemplates);
    while (!selections.atEnd()) {
        var tag = selections.item();
        var renderer = tag.renderer;
        var renderTemplate = tag.template;

        // construct the file name (most of it)
        var filename = new StringBuilder(outputDirectory);
        filename.Append(Path.DirectorySeparatorChar);
        filename.Append(baseFileName);
        filename.Append(renderer.FileTypeName);
        filename.Append("_");
        filename.Append(renderTemplate.Name);

        if (renderMode == RenderMode.Regions) {
            var regions = new Enumerator(Vegas.Project.Regions);
            var regionIndex = zero;
            while (!regions.atEnd()) {
                var region = regions.item();
                var regionFilename = new StringBuilder(filename);
                regionFilename.Append("[");
                regionFilename.Append(regionIndex);
                regionFilename.Append("]");
                // need to strip off the extension's leading "*"
                regionFilename.Append(renderer.FileExtension.substring(1));

                // Render the region
                renderStart = region.Position;
                renderLength = region.Length
                DoRender(regionFilename.ToString(), renderer, renderTemplate, renderStart, renderLength);
                regionIndex++;
                regions.moveNext();
            }
        } else {
            // need to strip off the extension's leading "*"
            filename.Append(renderer.FileExtension.substring(1));

            renderStart = new Timecode();
            renderLength = Vegas.Project.Length;
            
            DoRender(filename.ToString(), renderer, renderTemplate, renderStart, renderLength);
        }
        selections.moveNext();
    }
    
    // We need to close the current Vegas project in order to open the next project
    // and continue rendering
    Vegas.NewProject();
}

// perform the render.  The Render method returns a member of the
// RenderStatus enumeration.  If it is anything other than OK, exit
// the loops.  This will throw an error message string if the render
// does not complete successfully.
function DoRender(fileName, rndr, rndrTemplate, start, length) {
    // make sure the file does not already exist
    if (!overwriteExistingFiles && File.Exists(fileName)) {
        Vegas.NewProject();
        throw "File already exists: " + fileName;
    }

    // perform the render.  The Render method returns
    // a member of the RenderStatus enumeration.  If
    // it is anything other than OK, exit the loops.
    var status = Vegas.Render(fileName, rndrTemplate, start, length);

    // if the render completed successfully, just return
    if (status == RenderStatus.Complete)
        return;

    // if the user canceled, throw out a special message that won't be
    // displayed.
    if (status == RenderStatus.Canceled) {
        var cancelMsg = new String("User canceled");
        cancelMsg.skipMessageBox = true;
        throw cancelMsg;
    }

    // if the render failed, throw out a detailed error message.
    var msg : StringBuilder = new StringBuilder("Render failed:\n");
    msg.Append("\n    file name: ");
    msg.Append(fileName);
    msg.Append("\n    Renderer: ");
    msg.Append(rndr.FileTypeName);
    msg.Append("\n    Template: ");
    msg.Append(rndrTemplate.Name);
    msg.Append("\n    Start Time: ");
    msg.Append(start.ToString());
    msg.Append("\n    Length: ");
    msg.Append(length.ToString());
    throw msg;
}


// This class has all of the functions to create and display our dialog box

class BatchRenderDialog extends Form {
    var savebrowseButton : BrowseButton;
    var openbrowseButton : BrowseButton;
    var fileNameBox : TextBox;
    var openFileName : TextBox;
    var templateTree : TemplateTreeView;
    var renderProject : RadioButton;
    var renderRegions : RadioButton;
    var addAnother : CheckBox;
    var finishLabel : CheckBox;

    function BatchRenderDialog() {
        this.Text = "Multiple Project Batch Render";
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        this.MaximizeBox = false;
        this.StartPosition = FormStartPosition.CenterScreen;
        this.Width = 600;

        var titleBarHeight = this.Height - this.ClientSize.Height;
        var buttonWidth = 80;

        // displays the box for entering the file name of the project to be rendered
        openFileName = addTextControl("Project File", titleBarHeight + 6, 460, 10, vegFile);
        
        // displays the box for entering the base file name of the files to be rendered
        fileNameBox = addTextControl("Base File Name", titleBarHeight + 15, 460, 40, defaultBasePath);

        // creates and displays the browse button for browsing the directory tree
        // and selecting the project file to be rendered
      openbrowseButton = new BrowseButton(openFileName, fileNameBox, "open");
        openbrowseButton.Left = openFileName.Right + 4;
        openbrowseButton.Top = openFileName.Top - 2;
        openbrowseButton.Width = buttonWidth;
        openbrowseButton.Height = openbrowseButton.Font.Height + 12;
        openbrowseButton.Text = "Browse...";
        Controls.Add(openbrowseButton);
        
        // creates and displays the browse button for browsing the directory tree
        // and selecting the directory and base file name for the rendered files
        savebrowseButton = new BrowseButton(fileNameBox, "", "save");
        savebrowseButton.Left = fileNameBox.Right + 4;
        savebrowseButton.Top = fileNameBox.Top - 2;
        savebrowseButton.Width = buttonWidth;
        savebrowseButton.Height = savebrowseButton.Font.Height + 12;
        savebrowseButton.Text = "Browse...";
        Controls.Add(savebrowseButton);

        templateTree = new TemplateTreeView();
        templateTree.Left = 10;
        templateTree.Width = this.Width - 20;
        templateTree.Top = savebrowseButton.Bottom + 10;
        templateTree.Height = 300;
        templateTree.CheckBoxes = true;
        Controls.Add(templateTree);
        FillTemplateTree();

        var buttonTop = templateTree.Bottom + 16;
        var buttonsLeft = this.Width - (2*(buttonWidth+10));

        renderProject = addRadioControl("Render Project", 6, buttonTop);
        renderRegions = addRadioControl("Render Regions", renderProject.Right, buttonTop);

        renderProject.Checked = true;
                
        addAnother = addCheckbox("Add Another Project", 1, renderRegions.Right + 20, buttonTop-5);
        finishLabel = addCheckbox("to Render Queue", 0, renderRegions.Right + 20, buttonTop + 10);
               
        var okButton = new Button();
        okButton.Text = "OK";
        okButton.Left = this.Width - (2*(buttonWidth+10));
        okButton.Top = buttonTop;
        okButton.Width = buttonWidth;
        okButton.Height = okButton.Font.Height + 12;
        okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
        AcceptButton = okButton;
        Controls.Add(okButton);

        var cancelButton = new Button();
        cancelButton.Text = "Cancel";
        cancelButton.Left = this.Width - (1*(buttonWidth+10));
        cancelButton.Top = buttonTop;
        cancelButton.Height = cancelButton.Font.Height + 12;
        cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        CancelButton = cancelButton;
        Controls.Add(cancelButton);

        this.Height = titleBarHeight + okButton.Bottom + 8;

    }

    function addTextControl(labelName, left, width, top, defaultValue) {
        var label = new Label();
        label.AutoSize = true;
        label.Text = labelName + ":";
        label.Left = left;
        label.Top = top + 4;
        Controls.Add(label);

        var textbox = new TextBox();
        textbox.Multiline = false;
        textbox.Left = label.Right;
        textbox.Top = top;
        textbox.Width = width - (label.Width);
        textbox.Text = defaultValue;
        Controls.Add(textbox);

        return textbox;
    }

    function addRadioControl(labelName, left, top) {
        var label = new Label();
        label.AutoSize = true;
        label.Text = labelName;
        label.Left = left;
        label.Top = top + 4;
        Controls.Add(label);

        var radiobutton = new RadioButton();
        radiobutton.Left = label.Right;
        radiobutton.Width = 36;
        radiobutton.Top = top;
        Controls.Add(radiobutton);

        return radiobutton;
    }
    

    function addCheckbox(labelName, checkbox, left, top) {
        var label = new Label();
        label.AutoSize = true;
        label.Text = labelName;
        label.Left = left;
        label.Top = top + 4;
        Controls.Add(label);

        if (checkbox == 1) {
           var checkbox = new CheckBox();
           checkbox.Left = label.Right;
           checkbox.Width = 36;
           checkbox.Top = top;
           Controls.Add(checkbox);

           return checkbox;
        }
    }

    function FillTemplateTree() {
        var renderers = new Enumerator(Vegas.Renderers);
        while (!renderers.atEnd()) {
            var renderer = renderers.item();
            var rendererNode = new TreeNode(renderer.FileTypeName);
            rendererNode.Tag = renderer;
            templateTree.Nodes.Add(rendererNode);
            var templates = new Enumerator(renderer.Templates);
            while (!templates.atEnd()) {
                var template = templates.item();
                var templateNode = new TreeNode(template.Name);
                var tag = new Object();
                tag.renderer = renderer;
                tag.template = template;
                templateNode.Tag = tag;
                rendererNode.Nodes.Add(templateNode);
                templates.moveNext();
            }
            renderers.moveNext();
        }
    }

    function GetCheckedTemplates() {
        var checkedTemplates = new ArrayList();
        var rendererNodes = new Enumerator(templateTree.Nodes);
        while (!rendererNodes.atEnd()) {
            var rendererNode = rendererNodes.item();
            GetCheckedTemplatesHelper(checkedTemplates, new Enumerator(rendererNode.Nodes));
            rendererNodes.moveNext();
        }
        return checkedTemplates;
    }

    function GetCheckedTemplatesHelper(checkedTemplates, templateNodes) {
        if (templateNodes.atEnd()) return;
        var templateNode = templateNodes.item();
        if (templateNode.Checked) {
            checkedTemplates.Add(templateNode.Tag);
        }
        templateNodes.moveNext();
        GetCheckedTemplatesHelper(checkedTemplates, templateNodes);
    }
}


// Button subclass that shows a save file or open file dialog
class BrowseButton extends Button {
    var myResultBox = null;
    var openOrSave = null;
    var otherResultBox = null;

    function BrowseButton(resultBox, otherresultBox, purpose) {
        // allows result to be sent to main GUI
        myResultBox = resultBox;
        
        // lets us use the same class for saving a file and opening a file
        openOrSave = purpose; 

        // allows us to send data to other box on main GUI
        otherResultBox = otherresultBox; 
    }

    protected override function OnClick(e : EventArgs) {
        // if we are using the box to open a file then we
        // need to create the correct type of dialog box
        // and set the filter so that we only see Vegas project
        // files
        if (openOrSave == "open") {
            var saveFileDialog = new OpenFileDialog();
            saveFileDialog.Filter = "Vegas Project File (*.veg)|*.veg";

        // otherwise we need to create a save file dialog box and see
        // all files types
        } else {
            var saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "All Files (*.*)|*.*";
        }
        saveFileDialog.CheckPathExists = false;
        saveFileDialog.AddExtension = false;
        if (null != myResultBox || myResultBox == "") {
            var filename = myResultBox.Text;
            var initialDir = Path.GetDirectoryName(filename);
            if (Directory.Exists(initialDir)) {
                saveFileDialog.InitialDirectory = initialDir;
            }
            saveFileDialog.DefaultExt = Path.GetExtension(filename);
            saveFileDialog.FileName = Path.GetFileNameWithoutExtension(filename);
        } else {
            saveFileDialog.InitialDirectory = "c:\\";
        }
        if (System.Windows.Forms.DialogResult.OK == saveFileDialog.ShowDialog()) {
            if (null != myResultBox) {

                // If we are opening the project file to render we want to go ahead and
                // set the path to save the rendered file to the same directory.
                // That can be changed after the fact of course by clicking the browse
                // button for the saved file on the main GUI

                if (otherResultBox != "") {
                   otherResultBox.Text = Path.GetDirectoryName(saveFileDialog.FileName) + "\\" + Path.GetFileNameWithoutExtension(saveFileDialog.FileName) + "_";
                }
                myResultBox.Text = Path.GetFullPath(saveFileDialog.FileName);
            }
        }
    }
}

class TemplateTreeView extends TreeView {

    protected function OnAfterCheck(e : TreeViewEventArgs) {
        super.OnAfterCheck(e);
        if (e.Node.Checked) {
            if (0 != e.Node.Nodes.Count) {
                if ((e.Action == TreeViewAction.ByKeyboard) || (e.Action == TreeViewAction.ByMouse)) {
                    SetChildrenChecked(new Enumerator(e.Node.Nodes), true);
                }
            } else if (!e.Node.Parent.Checked) {
                e.Node.Parent.Checked = true;
            }
        } else {
            if (0 != e.Node.Nodes.Count) {
                if ((e.Action == TreeViewAction.ByKeyboard) || (e.Action == TreeViewAction.ByMouse)) {
                    SetChildrenChecked(new Enumerator(e.Node.Nodes), false);
                }
            } else if (e.Node.Parent.Checked) {
                if (!AnyChildrenChecked(new Enumerator(e.Node.Parent.Nodes))) {
                    e.Node.Parent.Checked = false;
                }
            }
        }
    }

    protected function SetChildrenChecked(kidz, checked) {
        if (kidz.atEnd()) return;
        var kid = kidz.item();
        if (kid.Checked != checked)
            kid.Checked = checked;
        kidz.moveNext();
        SetChildrenChecked(kidz, checked);
    }

    protected function AnyChildrenChecked(kidz) : boolean {
        if (kidz.atEnd()) return false;
        var kid = kidz.item();
        if (kid.Checked)
            return true;
        kidz.moveNext();
        return AnyChildrenChecked(kidz);
    }
}

 

iEmby wrote on 5/5/2024, 9:37 AM

Great job! If I wanted to have the project name at the beginning and the export template name at the end of the output file. How would I do that? Example: Project_RegionName_Template Name

Check this one...

https://www.vegascreativesoftware.info/us/forum/quick-render-script-use-it-share-it-and-give-feedback--145619/

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Little_Green_Dog wrote on 5/5/2024, 1:24 PM

Hi iEmby!

Great script mod! I like this variation MUCH better than the native one. Unlike the native one, I like how your version can save multiple ranges using the marker names to name each clip. Perfect for my needs!

Thank you for creating and sharing it, and keep up the great work!

Note: I was using the download from the top of this topic. I'll check out the one from your blog in a minute, and respond at the linked topic.

Mindmatter wrote on 5/6/2024, 7:36 AM

I can't find the blog for the updated version, I only downloaded the very first one at the start of the topic. Where can I find it?
Thanks!

AMD Ryzen 9 5900X, 12x 3.7 GHz
32 GB DDR4-3200 MHz (2x16GB), Dual-Channel
NVIDIA GeForce RTX 3070, 8GB GDDR6, HDMI, DP, studio drivers
ASUS PRIME B550M-K, AMD B550, AM4, mATX
7.1 (8-chanel) Surround-Sound, Digital Audio, onboard
Samsung 970 EVO Plus 250GB, NVMe M.2 PCIe x4 SSD
be quiet! System Power 9 700W CM, 80+ Bronze, modular
2x WD red 6TB
2x Samsung 2TB SSD

iEmby wrote on 5/6/2024, 8:32 AM

I can't find the blog for the updated version, I only downloaded the very first one at the start of the topic. Where can I find it?
Thanks!

https://vegasprofreetools.blogspot.com/

go to my blog and got to script section and download Quick Render

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Mindmatter wrote on 5/6/2024, 1:04 PM

Thanks!

AMD Ryzen 9 5900X, 12x 3.7 GHz
32 GB DDR4-3200 MHz (2x16GB), Dual-Channel
NVIDIA GeForce RTX 3070, 8GB GDDR6, HDMI, DP, studio drivers
ASUS PRIME B550M-K, AMD B550, AM4, mATX
7.1 (8-chanel) Surround-Sound, Digital Audio, onboard
Samsung 970 EVO Plus 250GB, NVMe M.2 PCIe x4 SSD
be quiet! System Power 9 700W CM, 80+ Bronze, modular
2x WD red 6TB
2x Samsung 2TB SSD