FORUMS: list search recent posts

Set Alpha Channel Script

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Frankie Jones
Set Alpha Channel Script
on Nov 17, 2014 at 4:12:56 pm

Hey,
Does anybody know of a script that just changes the Alpha channel to straight. I need to do a lot of clips at once, so just want to select all then run a script. I can't seem to find any scripts on google, but read a while ago on here that there was a script to do this, but cant find that post either :D
Any help much appreciated.
Frankie


Return to posts index

Graham Bernard
Re: Set Alpha Channel Script
on Nov 17, 2014 at 5:39:04 pm

[Frankie Jones] "but read a while ago on here that there was a script to do this, but cant find that post either :D"
Well, I use Excalibur. It sets the ALPHA nicely with one click. As to the historical reference, "Roger_64", back in 2/13/2004, on the OFFICIAL Vegas Scripting Forum, maybe do a search for that? ......

Grazie

Video Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 + PowerShot SX50HS Bridge


Return to posts index

Mike Kujbida
Re: Set Alpha Channel Script
on Nov 17, 2014 at 5:42:13 pm
Last Edited By Mike Kujbida on Nov 17, 2014 at 5:45:44 pm

Hopefully this works and the formatting doesn't get messed up.
If it does, I've attached the script.
8197_changealphachannel.js.zip



//ChangeAlphaChannel.js by Roger Magnusson (roger_74 at home dot se)
import Sony.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;
}
}
}
}


Return to posts index


Graham Bernard
Re: Set Alpha Channel Script
on Nov 17, 2014 at 5:49:58 pm

[Mike Kujbida] "Hopefully this works"
Nice one Mike! I read the earlier Vegas Scripting Forum post . . . I'd forgotten I'd been part of the much later Vegas Forum 2013 thread!

Grazie

Video Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 + PowerShot SX50HS Bridge


Return to posts index

Mike Kujbida
Re: Set Alpha Channel Script
on Nov 17, 2014 at 5:52:22 pm

My pleasure Grazie :)
I collect scripts and found it in my collection of useful tools to be shared!!


Return to posts index

Steve Rhoden
Re: Set Alpha Channel Script
on Nov 18, 2014 at 9:36:18 am

This .cs for changing to Premultiply:

//* Description: This script sets the alpha channel for selected events

using System;
using System.Collections;
using System.Windows.Forms;
using Sony.Vegas;

class EntryPoint
{
public void FromVegas(Vegas vegas)
{
try
{
foreach (Track track in vegas.Project.Tracks)
{
if (!track.IsVideo()) continue; // only process video tracks
foreach (TrackEvent trackEvent in track.Events)
{
if (trackEvent.Selected && trackEvent.ActiveTake != null)
{
VideoStream videoStream = trackEvent.ActiveTake.MediaStream as VideoStream;
videoStream.AlphaChannel = VideoAlphaType.Premultiplied;
}
}
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Set Alpha Channel Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}

Steve Rhoden (Cow Leader)
Film Maker & VFX Artist.
Owner of Filmex Creative Media.
Samples of my Work and Company can be seen here:
http://www.facebook.com/FilmexCreativeMedia


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]