Hi,
I'm using Vegas Pro 15 (Build 416) and C# for scripting. I'm trying to add a new media file (mp4 with video and audio track) to a specific video track. The media files are not added to the correct tracks, and I don't understand why. Can anyone advise please?
This is my code:
VideoTrack TrackVideoClip = vegas.Project.AddVideoTrack();
TrackVideoClip.Name = "Clips (Video)";
VideoTrack TrackOverlay1 = vegas.Project.AddVideoTrack();
TrackOverlay1.Name = "Overlay1";
AudioTrack TrackVideoClipAudio = vegas.Project.AddAudioTrack();
TrackVideoClipAudio.Name = "Clips (Audio)";
foreach (Track track in vegas.Project.Tracks)
{
track.Selected = false;
}
TrackVideoClip.Selected = true;
TrackVideoClipAudio.Selected = true;
vegas.OpenFile(Clip.filename);
The tracks are getting selected, but the media is landing in the wrong track "Overlay1" and an additional audio track gets added by the import. Screenshot of the result: https://i.imgur.com/iiWpDqg.png
Thanks