Comments

fetch wrote on 2/13/2004, 4:08 AM
No takers on this one?
roger_74 wrote on 2/13/2004, 5:46 AM
Try this:

//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;
      }
    }
  }
}
johnmeyer wrote on 2/13/2004, 8:26 AM
Roger,

Wow, that's an impressive response. You didn't just bang that one out in ten seconds and then hit the post button.
roger_74 wrote on 2/13/2004, 9:22 AM
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.