-
Sony Vegas Scripting – Can’t Manage a Take. Error – Invalid Take Object
I want to add media from the media pool to the first track of the project that I create first. For that, I need to create a Take Object and add the media stream to it. The stream is created successfully. But there is an issue with the take that I can’t understand yet. Here is the code:
//Adding video to the media pool
Vegas.OpenFileDialog(“C:\\Users\\sekhfa\\Desktop\\vidoes”, “true”);//adding a video track to the project so i can add that the first stream of the video I added to the media pool
var videotrack = new VideoTrack(0, “videoStream”);Vegas.Project.Tracks.Add(videotrack);
//I get the stream from the media I added to the media pool
var poolEnum = new Enumerator(Vegas.Project.MediaPool);var media = poolEnum.item();
var stream = media.Streams[0];
//I create a take from the stream
var take = Take.CreateInstance(Project.ActiveProject, stream);MessageBox.Show(take.Name);
I get this error: Invalid Take Object
what I want eventually is to add that take to the videoevent of the video track i created.

