-
FourPoints Script not working for Vegas 13
Posted by Cody Davis on September 24, 2018 at 12:07 pmFourPoints Script not working for Vegas 13. My version of Pluraleyes does not work in ver 14 or 15. Is there a script available that will work.
Edward Troxel replied 7 years, 11 months ago 3 Members · 4 Replies -
4 Replies
-
Edward Troxel
September 24, 2018 at 5:28 pm -
Cody Davis
September 24, 2018 at 10:01 pmIt was giving an error with details:C:\Users\owner\Documents\Vegas scripts\vegas 4 point selection script.cs(3) : The type or namespace name ‘Vegas’ could not be found (are you missing a using directive or an assembly reference?)
I don’t understand: the Vegas Pro 13 uses: using Sony.Vegas;
Vegas Pro 14+ uses: using ScriptPortal.Vegas;
____
This is the script I was using:public class EntryPoint
{
Vegas myVegas;public void FromVegas(Vegas vegas)
{
myVegas = vegas;//Change this line to change the distance between the points
Timecode FPDist = new Timecode(“00:00:01:00”);foreach(Track track in myVegas.Project.Tracks)
{
//Now check for Volume Envelope
if (track.IsAudio() && track.Selected)
{
// Find the volume envelope on this track – add if needed
Envelope VolEnv = FindEnvelope(track, EnvelopeType.Volume);
if (null == VolEnv)
{
VolEnv = new Envelope(EnvelopeType.Volume);
track.Envelopes.Add(VolEnv);
}double ClipVol = VolEnv.ValueAt(myVegas.SelectionStart);
//Now set the points
SetPoint(VolEnv, myVegas.Transport.LoopRegionStart, ClipVol);
SetPoint(VolEnv, myVegas.Transport.LoopRegionStart – FPDist, ClipVol);
SetPoint(VolEnv, myVegas.Transport.LoopRegionStart + myVegas.Transport.LoopRegionLength + FPDist, ClipVol);
SetPoint(VolEnv, myVegas.Transport.LoopRegionStart + myVegas.Transport.LoopRegionLength, ClipVol);
}
}
}private Envelope FindEnvelope(Track track, EnvelopeType etype)
{
foreach(Envelope env in track.Envelopes)
{
if (env.Type == etype)
{
return env;
}
}
return null;
}private void SetPoint(Envelope menv, Timecode PLoc, double PVal)
{
EnvelopePoint a = menv.Points.GetPointAtX(PLoc);if (a == null)
{
a = new EnvelopePoint(PLoc, PVal);
menv.Points.Add(a);
}
else
{
a.Y = PVal;
}
}}
-
George Dean
September 24, 2018 at 11:21 pmHi Cody,
I’m not a script writer, so this may not be anywhere close, but if it were me I would try……..
Add this without the quotes “using ScriptPortal.Vegas;” before the line in your script “public class EntryPoint”
You may also need to replace “Vegas myVegas;” to “ScriptPortal.Vegas.Vegas meVegas;”, again without quotes. Hopefully Edward will reply back with the correct stuff!
Best Regards……George
-
Edward Troxel
September 25, 2018 at 3:39 pm
Reply to this Discussion! Login or Sign Up
