Automate the creation of regions? Script help?

William_Robinette

Shallow Member
Guys,

I'm trying to get a little batch render thing going on in Vegas and would be greatly assisted by the automating of this simple step.

I would like to be able to select a whole bunch of files from my project media bin and drop it all down on the time line and then make each individual event it's own region.

The steps after that I have down and automated, but I don't know if there is a way to do what I outlined above automatically. I think the Excalibur plug-in can do what I want, but I don't need all it's other features and would rather not pay for it.

Any ideas?
 
I think the Excalibur plug-in can do what I want, but I don't need all it's other features and would rather not pay for it.
Just for the record, so will VASST Ultimate S Pro and Ultimate S Lite, the later is only $69 but I understand not wanting to spend money for just one function but there a lot of productivity tools in Excalibur and Ultimate S that will really make your editing a lot easier. (in the interest of "full disclosure" I work at VASST)

In the mean time, I've written you a script to do what you need:

Code:
/**
 *   Program: RegionsAtEvents.cs
 *    Author: John Rofrano 
 *   Purpose: This script will place a region at each event on the selected track(s)
 * Copyright: (c) 2010, Sundance Media Group / VASST
 *   Updated: February 27, 2010
**/
using System;
using System.Windows.Forms;
using Sony.Vegas;

class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        foreach (Track track in vegas.Project.Tracks)
        {
            // only process selected tracks
            if (!track.Selected) continue;

            foreach (TrackEvent trackEvent in track.Events)
            {
                Region region = new Region(trackEvent.Start, trackEvent.Length, trackEvent.ActiveTake.Name);
                try
                {
                    vegas.Project.Regions.Add(region);
                }
                catch (Exception e)
                {
                    MessageBox.Show(String.Format("Could not place a region at {0}\nError message is: {1}", trackEvent.Start.ToString(), e.Message), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
    }
}

Enjoy,

~jr
 
Thank you John!

I'll try this out when I get back to my edit bay. I will definitely take a closer look at what Excalibur and Ultimate S can do for my work flow/editing. I have bought VASST products in the past and have always been very impressed with the work you guys do.

Thanks again!
 
Back
Top