Thank you so much, John. That’s exactly what I needed.
Basically after editing a multicam video using two videos, I wanted to move the videos that are not muted to the second track, and the videos not used to the first track. Then I plan to make the muted videos a small window in one of the corners and unmute them, so that the track 2 video is the large view, but you can see the track 1 video showing in the corner.
This was my end result, it can only be executed ONCE per set of videos and is based on the default resolution of 1920×1080, but if I needed to modify anything, I could just mute the videos on track 1 before running the script again.
VIDEO OF THE RESULT: https://www.youtube.com/watch?v=N8fdAfv0kAo
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
public void FromVegas(Vegas app)
{
System.Collections.Generic.List muteWindow = new System.Collections.Generic.List();
System.Collections.Generic.List normWindow = new System.Collections.Generic.List();
foreach (Sony.Vegas.Track currentTrack in app.Project.Tracks)
{
if (currentTrack.IsAudio())
continue;
foreach (Sony.Vegas.TrackEvent currentEvent in currentTrack.Events)
{
if (currentEvent.Mute == true)
{
// Move to track 1
muteWindow.Add(currentEvent);
} else {
// Move to track 2
normWindow.Add(currentEvent);
}
}
}
foreach (Sony.Vegas.Track currentTrack in app.Project.Tracks)
{
foreach (Sony.Vegas.TrackEvent currentEvent in muteWindow)
{
currentEvent.Track = app.Project.Tracks[0];
}
foreach (Sony.Vegas.TrackEvent currentEvent in normWindow)
{
currentEvent.Track = app.Project.Tracks[1];
}
}
foreach (Sony.Vegas.TrackEvent currentEvent in muteWindow)
{
currentEvent.Mute = false;
VideoTrack videoTrack = app.Project.Tracks[0] as VideoTrack;
foreach (TrackMotionKeyframe keyframe in videoTrack.TrackMotion.MotionKeyframes)
{
keyframe.PositionX = -960+(480/2)+5;
keyframe.PositionY = 540-(270/2)-5;
keyframe.Width = 480;
keyframe.Height = 270;
}
}
}
}