Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro FourPoints Script not working for Vegas 13

  • FourPoints Script not working for Vegas 13

    Posted by Cody Davis on September 24, 2018 at 12:07 pm

    FourPoints 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

    Vegas Pro 13 uses: using Sony.Vegas;

    Vegas Pro 14+ uses: using ScriptPortal.Vegas;

    Make sure your four points script is using the correct “using” line at the top of the script.

    Edward Troxel

  • Cody Davis

    September 24, 2018 at 10:01 pm

    It 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 pm

    Hi 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

    At the top of the script above the lines you posted will be several “Using” lines. One of them will point to Vegas. You need to use the correct one based on my first post. Your error message indicates the wrong one is being used.

    Edward Troxel

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy