//ChangeAlphaChannel.js by Roger Magnusson
import SonicFoundry.Vegas;
var ChangeAlphaTo : VideoAlphaType = VideoAlphaType.Premultiplied; //Set this to the type you want
/*
VideoAlphaType.Undefined
VideoAlphaType.None
VideoAlphaType.Straight
VideoAlphaType.Premultiplied
VideoAlphaType.PremultipliedDirty
*/
for (var currentTrack : Track in Vegas.Project.Tracks)
{
if (currentTrack.IsVideo() == true)
{
for (var currentEvent : VideoEvent in currentTrack.Events)
{
if (currentEvent.Selected == true)
{
VideoStream(new Media(currentEvent.ActiveTake.MediaPath).Streams.GetItemByMediaType(currentEvent.MediaType, currentEvent.ActiveTake.StreamIndex)).AlphaChannel = ChangeAlphaTo;
}
}
}
}
I thought it would take ten seconds... :-)
But since the alpha channel can only be set on a videostream and not on an event I had to poke around a bit.