I thought there would be an old script readily available, but I didn't find one in my collection. Here's a new script that should do what you want. You can change the duration by editing the script with any text editor including Notepad. Note that it does NOT auto-ripple after trimming, a feature that could be easily added. Just copy the code into any text editor and save the file with a .cs extension and copy to your script menu folder. Good luck
//Trims length of selected events
using System;
using ScriptPortal.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
int seconds = 10; //Enter length in seconds
Timecode length = Timecode.FromSeconds(seconds);
foreach (Track track in vegas.Project.Tracks)
{
foreach (TrackEvent te in track.Events)
{
if (te.Selected) te.Length = length;
}
}
}
}
I thought there would be an old script readily available, but I didn't find one in my collection. Here's a new script that should do what you want. You can change the duration by editing the script with any text editor including Notepad. Note that it does NOT auto-ripple after trimming, a feature that could be easily added. Just copy the code into any text editor and save the file with a .cs extension and copy to your script menu folder. Good luck
//Trims length of selected events
using System;
using ScriptPortal.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
int seconds = 10; //Enter length in seconds
Timecode length = Timecode.FromSeconds(seconds);
foreach (Track track in vegas.Project.Tracks)
{
foreach (TrackEvent te in track.Events)
{
if (te.Selected) te.Length = length;
}
}
}
}
Both options worked beautifully, thanks to you lot.
You can also accomplish this (and more) with VASST Event Tools. On the Adjustments tab use the Adjust Selected Event Length (w/Keyframes) option. The difference is that if the event has keyframed motion, Event Tools will adjust the duration of the motion so that it fits the new length. The other scripts do not take this into account. This is important when used with photo montages that might have motion applied to events. 😉
Forgot that I already had written a head/tail trim script with a little GUI including an option for AutoRipple. Here's the link.https://tools4vegas.com/trim-frames/