Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro How to Auto Space Events on a Track?

  • How to Auto Space Events on a Track?

    Posted by Scott Bruffey on August 12, 2013 at 4:34 pm

    There’s probably an easy way to set this but I can’t find out where to make the change.

    I’m looking for a way to set the gap between events so when I drop in a number of events on a track, Vegas will automatically space them out. When it comes time to render I then need only run the Set Region Script, do a batch render and I’m finished.

    For now, I need to turn on ripple and manually move every clip over and create a gap that way.

    Any suggestions?

    Scott Bruffey replied 12 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Matt Carlson

    August 12, 2013 at 10:45 pm

    There is not actually a native way to do this. Vegas scripting is how we are expected to get things done… so here is a script.


    using System;
    using Sony.Vegas;

    public class EntryPoint
    {
    public void FromVegas(Vegas vegas)
    {
    int GAP = 20;

    foreach (Track track in vegas.Project.Tracks)
    {
    TrackEvent Last = null;
    foreach (TrackEvent ev in track.Events)
    {
    if (ev.Selected)
    {
    if (Last == null)
    {
    Last = ev;
    continue;
    }

    ev.Start = Last.End + Timecode.FromFrames(GAP);
    Last = ev;
    }
    }
    }
    }
    }

    This does not provide for any contingencies (like audio events not being the same size or position as the corresponding video events, etc.) It will make a 20 frame gap for all selected events on a per track basis. Change the GAP variable to whatever you prefer and select everything you want to move including any audio tracks. If you need a more comprehensive approach that deals with Groups or any other anomalies let me know.

  • Scott Bruffey

    August 12, 2013 at 10:48 pm

    That’s so awesome!! Thank you!

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