This script was requested here:
Have these scripts been written?
It removes all gaps and overlaps from all events, and also removes all resulting fades. However, there is no attempt to keep video and audio events synced up, so this may not be useful on all projects.
Copy the code below, paste it into Notepad, and save it with the extension "js".
Have these scripts been written?
It removes all gaps and overlaps from all events, and also removes all resulting fades. However, there is no attempt to keep video and audio events synced up, so this may not be useful on all projects.
Copy the code below, paste it into Notepad, and save it with the extension "js".
/**
* Program:
* Description: This script deletes empty space between events,
* and removes all overlaps between events, and removes all event fades
* on all tracks.
* No attempt is made to synchronize audio and video events.
* Author: John Meyer
* April 9, 2007
*
**/
import Sony.Vegas;
import System.Windows.Forms;
try
{
// step through all selected video events:
for (var track in Vegas.Project.Tracks) {
var tracktime = track.Events.Item(0).Start;
var Fadelength : Timecode = new Timecode("00:00:00.00");
for (var evnt in track.Events) {
var currTake : Take = evnt.ActiveTake;
var currOffset : Timecode = evnt.ActiveTake.Offset;
evnt.Start = tracktime;
currTake.Offset = currOffset;
evnt.FadeIn.Length = new Timecode(Fadelength);
evnt.FadeOut.Length = new Timecode(Fadelength);
tracktime = tracktime + evnt.Length;
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}