A script for splitting an event evenly?

PossibilityX wrote on 5/21/2005, 7:10 PM
I wonder if such a thing exists:

I'm looking for a script that will split an event into multiple smaller events, all of a particular duration.

I'd like to be able to tell the script: "Split this clip into a series of smaller clips, each X seconds (or frames) in duration."

Then I'd like to tell the script: "Now remove every other clip," starting with either the 1st or 2nd clip.

And finally: "Now close the gaps where the clips were removed," effectively ripple editing ONLY that sequence.

Anyone know of such a script / plugin?

Does Ultimate S do this?

Comments

Spot|DSE wrote on 5/21/2005, 7:35 PM
Ultimate S does part of this, yes, but not all of it. There are free scripts that accomplish part of this too, and the two combined would do all of this.
PossibilityX wrote on 5/21/2005, 8:04 PM
Spot, sorry to sound confused:

On the VASST site it says of US: "Additionally, markers may be placed at specific intervals, contracted in distance by specific lengths of time, and can be edited with cut points."

Does "can be edited with cut points" mean that the event splitting will 1) automatically occur and a marker inserted at the split 2) occur only on my command after all markers are placed 3) or simply that markers will be placed at the desired interval but that I must manually make each split?
jetdv wrote on 5/21/2005, 8:44 PM
The "Blink" script found at http://midihead.servehttp.com/ may be similar to what you are trying to achieve. It is written for Vegas 4 so it would have to be updated for Vegas 5 or 6.
JohnnyRoy wrote on 5/22/2005, 9:15 AM
> Does "can be edited with cut points" mean that the event splitting will 1) automatically occur and a marker inserted at the split 2) occur only on my command after all markers are placed 3) or simply that markers will be placed at the desired interval but that I must manually make each split?

You can achieve the splits with Ultimate S if you place the event in a new instance of Vegas. Go to the Markers tab of Ultimate S, press Clear Page (good habit), select Place Markers At Regular Intervals and specify the length of the cuts, then select Split Events at Markers, then select Remove All Markers, finally press OK. You will end up with the event cut at the interval you want. You still need to delete every other event. This must be done in a new instance because the current version of Ultimate S will continue placing markers for the duration of the project, not just the event.

This script will do exactly what you want (I was working on something similar for Ultimate S anyway). It doesn’t have a GUI (I’ll save that for the next version of Ultimate S ;-) ) but you can manually change the chopInterval to get it to chop up the selected event, delete every other chop, and close the gaps. Enjoy,
/**
* Program: ChopEveryNth.js
*
* This script will chop up the selected event deleting every other chop.
*
* Author: Johnny "Roy" Rofrano
* Revision Date: May 22, 2005
**/
import System.Windows.Forms;
import System.Collections;
import Sony.Vegas;

var chopInterval : Timecode = new Timecode("00:00:01;00");

try
{
for (var track in Vegas.Project.Tracks)
{
for (var trackEvent in track.Events)
{
if (trackEvent.Selected)
{
var eventsToDelete : ArrayList = new ArrayList();
var eventsToRipple : ArrayList = new ArrayList();
var rippleStart : Timecode = trackEvent.Start + chopInterval;

var currentTime : Timecode = chopInterval;
var eventLength : Timecode = trackEvent.End - trackEvent.Start;

var cutEvent : Boolean = true; // toggle every other events
while (currentTime < eventLength)
{
var newEvent : TrackEvent = trackEvent.Split(chopInterval);
trackEvent = newEvent;
trackEvent.Selected = false;
if (cutEvent)
{
eventsToDelete.Add(trackEvent);
}
else
{
eventsToRipple.Add(trackEvent);
}
cutEvent = !cutEvent; // flip toggle
currentTime += chopInterval;
}
// Remove events to delete
for (var evnt in eventsToDelete)
{
track.Events.Remove(evnt);
}
// move events to ripple
for (var evnt in eventsToRipple)
{
evnt.Start = rippleStart;
rippleStart = evnt.End;
}

}
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "ChopEveryNth Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
~jr
PossibilityX wrote on 5/22/2005, 9:50 AM
Thanks, Johnny, for the script and the info.

Ultimate S is certainly on my "buy it soon" list.

(Actually, it's on my "Shoulda bought it months ago" list!)
JohnnyRoy wrote on 5/22/2005, 10:57 AM
Actually, I just realized that Ultimate S already does the whole thing! (Man I gotta get out more...) ;-)

Just for the record here’s what you do:

1. In Ultimate S go to the Markers tab
3. Press Clear Page (good habit)
3. Select Place Markers At Regular Intervals and specify the length of the cuts
4. Select Delete Between Markers and check Ripple Events
5. Select Remove All Markers since you only placed them for the cuts
6. Press OK

Wow I can’t believe I didn’t see this earlier.

~jr
epirb wrote on 5/22/2005, 4:29 PM
Dang Johnny,
we are going to have to start calling you the : Script Keeper

Mean only in the best possible sense and praise!