How Do I Go Through Tracks And Events On The Vegas Timeline?

Going through the timeline is a very common task and this video illustrates how to easily look at every track and every event on those tracks.

Next we learn to look at some properties by checking to see if an event is selected. If the event is selected, we deselect it. If the event is not selected, we select it. Finally, we take a brief look at checking to see if a track is selected as well.

This script builds on the script created in the previous videos. If you have not watched them, it is encouraged that you do so.

Please sign up here and leave comments with suggestions of tasks you would like to see automated. You can help guide the direction of these videos. Also, subscribe to my YouTube channel.

For scripts with no display needed, you can either run the .dll file we compiled in this example or you can run the actual .cs text file. In this case, you can simply paste the code into Notepad, save it as “ToggleSelected.cs” and you can then select that .cs file making it easier to share with other people. However, using Visual Studio still makes it easier to create the .cs file because of intellisense helping with auto completion.

using System;
using System.Collection.Generic;
using System.Test;
using System.Windows.Forms;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.Selected)
                {
                    foreach (TrackEvent myEvent in myTrack.Events)
                    {
                        myEvent.Selected = !myEvent.Selected;
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

4 thoughts on “How Do I Go Through Tracks And Events On The Vegas Timeline?”

  1. Thanks for the video!
    I’m looking for a script that can render out videos on multiple tracks:

    Looking for a script that let’s me render regions on multiple tracks. Imagine 3 video tracks, and 3 regions. The result should be 9 files.

    E.g
    RegionNameA_track1.mp4
    RegionNameB_track1.mp4
    RegionNameC_track1.mp4
    RegionNameA_track2.mp4
    RegionNameB_track2.mp4
    (…)

    Vegasaur “Transcoder” has tons of options, but not this one…

    Grateful for help!

  2. Thank you. I’ll certainly add this to the list. We need learn to go through the markers/regions first, we also need a user interface, we need to learn how to select which renderer we want to use, and then learn how to actually do a render. Finally, we can then add that all together make this happen. So we will certainly get to this as we learn the various parts of it first. So there’s certainly a lot of pieces to this particular request.

Leave a Reply