Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro A Way to create Multiple Regions at Once?

  • A Way to create Multiple Regions at Once?

    Posted by Josh Money on February 5, 2010 at 5:32 pm

    Hey Guys, I’m an audio designer for video games and sometimes we have to edit thousands of lines of dialogue using Sony Vegas and then export the regioned file to Sound Forge for naming etc. The editing process is very smooth however when it comes to Region creation, the only way I know to go about doing it is to individually double click each edited take and use the shortcut “R” to create a region for that selection. After editing a thousand takes this process of creating regions seems unnecessarily lengthy for something that should seemingly be automatic.

    Is there a way to simply select multiple edits and have Vegas automatically create individual regions out of each one? I have searched everywhere for how to do this and can find nothing yet this feature would make perfect sense! I have emailed Sony about it and received no reply which makes me think this is something they know about but still haven’t implemented. Any help is much appreciated. Thanks!

    Edward Troxel replied 9 months ago 5 Members · 6 Replies
  • 6 Replies
  • Mike Kujbida

    February 5, 2010 at 5:40 pm

    Here’s an old script from John Meyer that should work for you.
    I just tried it successfully in Vegas 8 Pro.
    Save it as JHM_AddRegionsToEvents.js

    /**
    * This script will add regions for all events on the selected track
    *
    * By John Meyer 11/4/2003 (with ideas from Edward Troxel’s “Markers to Events” script)
    *
    **/

    import System;
    import System.IO;
    import System.Windows.Forms;
    import Sony.Vegas;
    var evnt : TrackEvent;
    var myRegion : Region;
    var RegionNumber;

    try {

    //Find the selected event
    var track = FindSelectedTrack();
    if (null == track)
    throw “no selected track”;

    var eventEnum = new Enumerator(track.Events);
    RegionNumber = 1;
    while (!eventEnum.atEnd()) {
    evnt = TrackEvent(eventEnum.item());
    myRegion = new Region(evnt.Start,evnt.Length,RegionNumber.ToString()); //Insert a region over this event
    Vegas.Project.Regions.Add(myRegion);
    eventEnum.moveNext();
    RegionNumber++;
    }

    } catch (e) {
    MessageBox.Show(e);
    }

    function FindSelectedTrack() : Track {
    var trackEnum = new Enumerator(Vegas.Project.Tracks);
    while (!trackEnum.atEnd()) {
    var track : Track = Track(trackEnum.item());
    if (track.Selected) {
    return track;
    }
    trackEnum.moveNext();
    }
    return null;
    }

  • Josh Money

    February 5, 2010 at 7:21 pm

    Mike,

    Thank you for the fastest reply in forum history. That worked perfectly!!! I can’t thank you enough!

    Josh Money

  • Mike Kujbida

    February 5, 2010 at 7:58 pm

    Josh, gold bars are always a nice way to say thanks 🙂

    Seriously, you caught me at a good time and I was pretty sure I had a script to do that in my collection somewhere.
    Always happy to help!!

  • Fabio Mereghetti

    August 29, 2010 at 8:30 am

    Would it be possible to mod the script to make it assign the media name to its region?

    I created many named subclips and I have to convert them all from 50i to 50p as a first step in order to get a smoother slow motion effect.
    I put them all on a single track and I would like the 50p files created automatically with the “Batch render with region names” script could retain the original subclip name.

    Thanks.

  • Joseph Windowstosky

    February 24, 2024 at 12:25 pm

    I come from the future, with an update for anyone trying to do this. I ran this in my antique Vegas Pro 9 and it worked great, turning events to regions and retaining the active take name.

    Save with .js extension – this isn’t a .cs.

    import System;

    import System.IO;

    import System.Windows.Forms;

    import Sony.Vegas;

    var evnt : TrackEvent;

    var myRegion : Region;

    try {

    //Find the selected event

    var track = FindSelectedTrack();

    if (null == track)

    throw "no selected track";

    var eventEnum = new Enumerator(track.Events);

    while (!eventEnum.atEnd()) {

    evnt = TrackEvent(eventEnum.item());

    myRegion = new Region(evnt.Start,evnt.Length,evnt.ActiveTake.Name);

    Vegas.Project.Regions.Add(myRegion);

    eventEnum.moveNext();

    }

    } catch (e) {

    MessageBox.Show(e);

    }

    function FindSelectedTrack() : Track {

    var trackEnum = new Enumerator(Vegas.Project.Tracks);

    while (!trackEnum.atEnd()) {

    var track : Track = Track(trackEnum.item());

    if (track.Selected) {

    return track;

    }

    trackEnum.moveNext();

    }

    return null;

    }

  • Edward Troxel

    March 8, 2024 at 7:06 pm

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy