Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro shortcut key for selecting clip above or below current clip on timeline?

  • shortcut key for selecting clip above or below current clip on timeline?

    Posted by Gilles Gagnon on August 19, 2013 at 10:37 pm

    Is there such a thing?
    Looked in a shortcut key document but didn’t see it.

    Gilles

    Gilles Gagnon replied 12 years, 11 months ago 3 Members · 5 Replies
  • 5 Replies
  • Tyson Onaga

    August 19, 2013 at 11:35 pm

    Don’t think so. You’d probably need two scripts to do this, one for selecting the Event above, one for the Event below. I assume “above” means the Track immediately above the Track that has the currently selected Event.

    You would select a single Event and probably invoke the desired script with a hotkey. You can bind a hotkey to a script via Options.Customize Keyboard; look under the “Script.*” section.

    Options.Customize Keyboard, Script.* items should be identical to Tools.Scripting, “list of scripts”.

  • Gilles Gagnon

    August 19, 2013 at 11:40 pm

    Thanks Tyson.

    Gilles

  • Tyson Onaga

    August 20, 2013 at 2:20 am

    Here is a very rudimentary script (Track_eventSelectAbove.cs):

    public void FromVegas( Vegas vegasApp )
    {
    try
    {
    int nTrack = 0;

    // For all tracks in the Project ...
    foreach ( Track track in vegasApp.Project.Tracks )
    {
    if ( !track.Selected )
    {
    nTrack++;
    continue;
    }

    // For all Events on the "track" ...
    foreach ( VideoEvent videoEvent in track.Events )
    {
    if ( !videoEvent.Selected )
    continue;

    // Get the Timecode for the selected Event ...
    Timecode tcStart = videoEvent.Start;
    Timecode tcLength = videoEvent.Length;

    ShowMessage(
    "Track_eventSelectAbove.cs",
    "Track Selected: " + track.Name + "\n\n" +
    "Event Timecode: " + tcStartMS.ToString() + "\n\n" +
    ""
    );

    // Topmost track? [CHANGE_HERE.A]
    if ( nTrack == 0 )
    ShowMessage( "Track_eventSelectAbove.cs", "No track above!" );
    else
    {
    // Get the Track above ... [CHANGE_HERE.B]
    Track trackAbove = vegasApp.Project.Tracks[ nTrack - 1 ];
    ShowMessage(
    "Track_eventSelectAbove.cs",
    "Track Selected: " + track.Name + "\n\n" +
    "Event Timecode: " + tcStartMS.ToString() + "\n\n" +
    "Track Above: " + trackAbove.Name + "\n\n" +
    ""
    );

    // Find the Event on trackAbove that starts at tcStart ...
    foreach ( VideoEvent videoEventAbove in trackAbove.Events )
    {
    Timecode tcStartAbove = videoEventAbove.Start;
    Timecode tcLengthAbove = videoEventAbove.Length;

    // Toggle Selected only on EXACT starting times! [CHANGE_HERE.C]
    if ( tcStart == tcStartAbove )
    {
    videoEventAbove.Selected = true;
    break;
    }
    }
    }
    } // foreach

    nTrack++;
    } // foreach
    }
    catch (Exception e)
    {
    MessageBox.Show(e.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
    }
    } // FromVegas()

    private void ShowMessage( string msgTitle, string msgBody )
    {
    MessageBox.Show( msgBody, msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Information );
    } // ShowMessage()

    Note:
    a. This only handles the Track above case. To handle the Track below case, you would need to

    a.1 Create a duplicate script (different .cs name)

    a.2 Change [CHANGE_HERE.A] to
    if ( nTrack == vegasApp.Project.Tracks.Count – 1 )

    a.3 Change [CHANGE_HERE.B] to
    Track trackAbove = vegasApp.Project.Tracks[ nTrack + 1 ];

    a.4 Change the variables names (eg, trackAbove to trackBelow)

    b. This will select an “above” Event ONLY if it has the EXACT same start time as the Selected Event. If you need more flexibility (ie, overlapping Events), then you need to change the expression in [CHANGE_HERE.C]
    if ( tcStart == tcStartAbove )
    to use the values in tcLength and tcLengthAbove.

    c. Comment out or remove the ShowMessage() debug statements when done.

  • Stephen Mann

    August 20, 2013 at 4:48 am

    “Is there such a thing?”
    No, because there are no clips on the timeline – only events.

    The Vegasaur tool (reasonably priced and indispensable here) has an event selector, but I’ve never used it. I just point and click.

    Steve Mann
    MannMade Digital Video
    http://www.mmdv.com

  • Gilles Gagnon

    August 20, 2013 at 10:53 am

    Thanks a bunch Tyson. Quite the code.

    Thanks for the input Stephen. I’ll also check out the Vegasaur tool. I do have Vaast Ultimate, which I use every now and then.

    Gilles

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