FORUMS: list search recent posts

Deleting empty space lining up clips from all tracks

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Grace Hunter
Deleting empty space lining up clips from all tracks
on Jun 24, 2014 at 6:32:21 pm

So I have five different tracks in my timeline, and I have to click and drag the clips together until I see the blue snap line to get all the clips to line up on their respective rows. This is what I mean:



I don't want any of the video layers to play on top of each other, but I want there to be no empty space between the clips on all five tracks collectively, as if there was only one track with no space in between the clips, if that makes any sense. Is there a script to do this? Or an easier way?


Return to posts index

Matt Carlson
Re: Deleting empty space lining up clips from all tracks
on Jun 24, 2014 at 8:40:09 pm

This script should do what you are asking. The script as written will concatenate all the events in the project. If there are other events not shown in your screen grab that you do not want affected or you just want to do selected events you need to change the line

bool ALLEVENTS = true;

to

bool ALLEVENTS = false;

When set to false the script will only concatenate events that are selected (obviously you have to have selected events for this to work).


// Close Gaps For Multiple Tracks

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

public class EntryPoint {

Vegas myVegas;

//Change this to false if you want to affect only selected events
bool ALLEVENTS = true;

public void FromVegas(Vegas vegas)
{
SelectedEvents Selected = new SelectedEvents(vegas,ALLEVENTS);
Selected.SortByStartTime();
for(int i = 0; i < Selected.Events.Count - 1; i++)
{
Selected.Events[i+1].Start = Selected.Events[i].End;
}
}


}

public class SelectedEvents
{
public List Events;

public SelectedEvents(Vegas vegas, bool allevents)
{
Events = new List();
foreach(Track t in vegas.Project.Tracks)
{
foreach(TrackEvent ev in t.Events)
{
if (ev.Selected || allevents) Events.Add(ev);
}
}
}

public void SortByStartTime()
{
Events.Sort((x,y) => x.Start.CompareTo(y.Start));
}

}



Return to posts index

Grace Hunter
Re: Deleting empty space lining up clips from all tracks
on Jun 25, 2014 at 12:08:04 am

Thank you so much! I however, have run into a problem. I feel like an idiot, but I just got vegas pro a couple days ago, and I am new to scripts. I have pasted the script into text edit, and put .js at the end of the name, but when I try to use the script, this is what happens:



I have used another script for vegas pro, and it worked, but the difference is that I downloaded the file directly from the internet, I didn't copy and paste it. So...how do I do that?


Return to posts index


Matt Carlson
Re: Deleting empty space lining up clips from all tracks
on Jun 25, 2014 at 2:06:50 am

Scripts can either be .js (Javascript) or .cs (C#)

This is done in C# so the extension needs to be .cs


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]