can anyone help fix this script so it works?
It's supposed to go through a project and strip out all unused takes from all events.
thanks!
using Sony.Vegas;
using System.Windows.Forms;
using System.Collections;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
ArrayList removeThese = new ArrayList();
// step through all video events:
foreach (Track track in Vegas.Project.Tracks) {
foreach (TrackEvent evnt in track.Events) {
foreach (Take take in evnt.Takes) {
if (!take.IsActive) {
removeThese.Add(take);
}
}
foreach (Take take in removeThese)
{
evnt.Takes.Remove(take);
}
removeThese.Clear();
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
It's supposed to go through a project and strip out all unused takes from all events.
thanks!
using Sony.Vegas;
using System.Windows.Forms;
using System.Collections;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
ArrayList removeThese = new ArrayList();
// step through all video events:
foreach (Track track in Vegas.Project.Tracks) {
foreach (TrackEvent evnt in track.Events) {
foreach (Take take in evnt.Takes) {
if (!take.IsActive) {
removeThese.Add(take);
}
}
foreach (Take take in removeThese)
{
evnt.Takes.Remove(take);
}
removeThese.Clear();
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}