Chop-off Front Script

ram17 wrote on 7/21/2019, 6:17 AM

First of all CTTO of this script. Thank you.

I just want some help on what line/s to change in this script to chop of the end of a clip. It was programmed to chop off the start.

I'm not a geek of programming language so I need some favor on this. Thanks.

/**
 * This script will chop off the front of a clip by the specified number of frames
 * 
 * Written By: Edward Troxel
 * www.jetdv.com/tts
 * Modified: 05-29-2003
 **/

import System;
import System.IO;
import System.Windows.Forms;
import ScriptPortal.Vegas;


try {
  var ChopDist : Timecode = new Timecode("00:00:00:20");
  var mtc : Double;

  //Go through the list of Tracks
  var trackEnum = new Enumerator(Vegas.Project.Tracks);
  while (!trackEnum.atEnd()) {
    var track : Track = Track(trackEnum.item());

    //Go through the list of Events
    var eventEnum = new Enumerator(track.Events);
    while (!eventEnum.atEnd()) {
      var evnt : TrackEvent = TrackEvent(eventEnum.item());

      if (evnt.Selected) {

        mtc = ChopDist.ToMilliseconds();
        var dStart : Double = evnt.Start.ToMilliseconds();
        var dLength : Double = evnt.Length.ToMilliseconds();
        var dStart = dStart + mtc;
        var dLength = dLength - mtc;

        evnt.AdjustStartLength(new Timecode(dStart), new Timecode(dLength), false);

      }
      eventEnum.moveNext();
    }
    trackEnum.moveNext();
  }


} catch (e) {
    MessageBox.Show(e);
}

 

Comments

jetdv wrote on 7/21/2019, 8:13 AM

Change:

 

mtc = ChopDist.ToMilliseconds();        

var dStart : Double = evnt.Start.ToMilliseconds();        

var dLength : Double = evnt.Length.ToMilliseconds();        

var dStart = dStart + mtc;        

var dLength = dLength - mtc;        

evnt.AdjustStartLength(new Timecode(dStart), new Timecode(dLength), false);

 

 

to:

 

mtc = ChopDist.ToMilliseconds();

evnt.Length = new Timecode(evnt.Length.ToMilliseconds() - mtc);

 

Harold-Linke wrote on 7/21/2019, 10:32 AM

a chop of end of selected events scripts is included in VEGASPython.

https://www.hlinke.de/dokuwiki/doku.php?id=en:vegas_python_download

Harold

ram17 wrote on 7/21/2019, 8:10 PM

Thank you so much ​​​​​​ @jetdv & @Harold-Linke

wwaag wrote on 7/22/2019, 8:46 PM

Here's another free script with a simple GUI and also an option to auto-ripple.

You can download it here https://tools4vegas.com/trim-frames/