Add one second script?

Grazie wrote on 9/24/2016, 2:34 PM

 

Now, the Add One Second script, what do I edit in that? See below:-

using Sony.Vegas;

public class EntryPoint
{
    Vegas myVegas;
    Timecode offset = new Timecode("00:00:01:00"); //1 second

    public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;

        myVegas.SelectionLength = myVegas.SelectionLength + offset;
    }
}

 

Comments

Marco. wrote on 9/24/2016, 2:43 PM

In first line replace 

using Sony.Vegas;

against

using ScriptPortal.Vegas;

That should do it.

rs170a wrote on 9/24/2016, 7:46 PM

Grazie, I have no idea if this is of any help or not but here's the one our good friend Edward modified.

Mike

 

/**
 * This script will add a one second Fade In and out to all selected events.
 *
 * Written By: Edward Troxel
 * Copyright 2016 - JETDV Scripts
 * Modified: 08-26-2016
 * Converted to .CS and new Vegas namespace
 **/

 

using System;
using ScriptPortal.Vegas;

 


public class EntryPoint
{
  Vegas myVegas;

 

  public void FromVegas(Vegas vegas)
  {
    myVegas = vegas;

 

    foreach (Track track in myVegas.Project.Tracks)
    {
        foreach (TrackEvent trackEvent in track.Events)
        {
            if (trackEvent.Selected)
            {
                trackEvent.FadeIn.Length = new Timecode(1000);
                trackEvent.FadeOut.Length = new Timecode(1000);
            }
        }
    }
  }
}

Grazie wrote on 9/24/2016, 8:15 PM

Marco, once I'm back at my PC I'll do it. Thank you.

Mike, this isn't the Fade In Fade Out from Edward, all this add OneSecond script does is to add one second to the end of a Selection ready for Marco's V2H script.

Grazie wrote on 9/24/2016, 10:47 PM

Yup, that works Marco.

However . . .  Using the Script doesn't create an UNDO option on the VP14 Toolbar. Any ideas why?

 

Marco. wrote on 9/25/2016, 4:43 AM

I don't know but I think in general there are some properties if modified by a script won't create undos.

Grazie wrote on 9/25/2016, 4:45 AM

Ok.

rs170a wrote on 9/26/2016, 6:49 AM

Oops. My mistake Grazie :(

Grazie wrote on 9/26/2016, 6:58 AM

I've done much much worse - no worries Mike!