Strange - I have the PAL version of this script, and I have used it successfully before, but now, in 8.0c, It adds 30 fps T/C instead of 25 fps.
Any ideas why? - and whether I can correct this by altering the script - currently reads as below. In the absence of a solution, I shall have to add it separately to 60 clips in Media Pool.
_______________
edit - I've just done it the LONG way - took about 20 mins - I've got some more shoots coming up though, so I'd still very much like the solution!
_______________
/**
* This script will add an effect to each item in the current
* project's media pool.
*
* Revision Date: Jan. 2, 2007
**/
using System;
using Sony.Vegas;
class EntryPoint
{
// plugInClassID is the class id of the effect plug-in you want to
// add. The class id is used rather than the name so the script
// will still work in localized versions of Vegas.
Guid plugInClassID = new Guid("2869bb94-4971-4ccc-94ca-743666a85938"); // "Sony Timecode"
// presetName is the name of the preset you want to use. Set it to
// null if you want the default preset.
// String presetName = null;
String presetName = "PAL";
public void FromVegas(Vegas vegas)
{
PlugInNode plugIn = vegas.VideoFX.GetChildByClassID(plugInClassID);
if (null == plugIn)
{
throw new ApplicationException("Could not find video plug-in.");
}
foreach (Media media in vegas.Project.MediaPool)
{
// only add the effect if the media object has video
if (!media.HasVideo())
continue;
// and if it does not already have the effect
if (MediaHasEffect(media, plugIn))
continue;
Effect effect = new Effect(plugIn);
media.Effects.Add(effect);
if (null != presetName)
effect.Preset = presetName;
}
}
public bool MediaHasEffect(Media media, PlugInNode plugIn)
{
foreach (Effect effect in media.Effects)
{
if (effect.PlugIn == plugIn)
return true;
}
return false;
}
}
Any ideas why? - and whether I can correct this by altering the script - currently reads as below. In the absence of a solution, I shall have to add it separately to 60 clips in Media Pool.
_______________
edit - I've just done it the LONG way - took about 20 mins - I've got some more shoots coming up though, so I'd still very much like the solution!
_______________
/**
* This script will add an effect to each item in the current
* project's media pool.
*
* Revision Date: Jan. 2, 2007
**/
using System;
using Sony.Vegas;
class EntryPoint
{
// plugInClassID is the class id of the effect plug-in you want to
// add. The class id is used rather than the name so the script
// will still work in localized versions of Vegas.
Guid plugInClassID = new Guid("2869bb94-4971-4ccc-94ca-743666a85938"); // "Sony Timecode"
// presetName is the name of the preset you want to use. Set it to
// null if you want the default preset.
// String presetName = null;
String presetName = "PAL";
public void FromVegas(Vegas vegas)
{
PlugInNode plugIn = vegas.VideoFX.GetChildByClassID(plugInClassID);
if (null == plugIn)
{
throw new ApplicationException("Could not find video plug-in.");
}
foreach (Media media in vegas.Project.MediaPool)
{
// only add the effect if the media object has video
if (!media.HasVideo())
continue;
// and if it does not already have the effect
if (MediaHasEffect(media, plugIn))
continue;
Effect effect = new Effect(plugIn);
media.Effects.Add(effect);
if (null != presetName)
effect.Preset = presetName;
}
}
public bool MediaHasEffect(Media media, PlugInNode plugIn)
{
foreach (Effect effect in media.Effects)
{
if (effect.PlugIn == plugIn)
return true;
}
return false;
}
}