Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro changing all take names (macro?)

  • Matt Carlson

    July 24, 2013 at 6:03 am

    and….. disregard all the other posts. Programming for .Net 2.0 (although not entirely necessary with Vegas anymore) turns my mind in to a pretzel. This is a script that will run smoothly…

    using System;
    using System.Collections.Generic;
    using Sony.Vegas;

    public class EntryPoint
    {
    public void FromVegas(Vegas vegas)
    {
    List OrderedEvents = new List();
    bool all = true;

    foreach (Track track in vegas.Project.Tracks)
    {
    if (track.IsAudio()) continue;
    foreach (TrackEvent ev in track.Events)
    {
    if (all || ev.Selected)
    {
    OrderedEvents.Add(ev);

    }
    }
    }
    int count = 1;

    OrderedEvents.Sort(delegate (TrackEvent e1, TrackEvent e2)
    {
    return e1.Start.CompareTo(e2.Start);
    });

    string basename = OrderedEvents[0].ActiveTake.Name;
    foreach (TrackEvent ev in OrderedEvents)
    {
    ev.ActiveTake.Name = basename + count;
    count++;
    }
    }
    }

  • Gilles Gagnon

    July 24, 2013 at 11:47 am

    Thanks Matt!

    I appreciate your efforts. I’ll give this last macro a try today and report back. You’re correct, I don’t need the audio events named.

    No, I don’t need the events numbered over multiple tracks.

    The best solution might be to only work the script on selected events (video events).

    Is this easy to do?

    Which events does the script in its latest version affect?

    Gilles

  • Matt Carlson

    July 24, 2013 at 5:30 pm

    There is already an easy fix in the script if you just want to do selected events. Change the line

    bool all = true;

    to

    bool all = false;

    then the script will only use selected events. This last script should not have any problems working on an entire project though. It only numbers video events and will work with any number of tracks.

Page 2 of 2

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