This script will let you easily create and edit "L" and "J" cuts.
To use, click in the middle of the first of two events that you want to L or J cut (actually, the cursor simply needs to be over the first of the two events). Then, run the script. The video from the first event, and the audio from the following event will be shortened by one second in a mirror image of each other. You can then trim the audio or video of either event without affecting that event's associated audio and video. Despite this, the audio and video are still locked together when you move them so they don't get out of sync. You can "butt" the audio and crossfade the video or any combination of things.
The edges of the events on the opposite sides from the L and J cut are still locked together.
I recommend that you turn off ripple edit when doing L and J cuts. You can the turn it back on again (or use "F" or "Ctrl-F") to close the gap with all the subsequent events.
You can modify one line in the script, as described in the script comments below, to create a J cut instead of an L cut (I actually don't know which one is created here). I suppose I could modify the script so you could choose which type of cut you want each time, but I didn't like the idea of having that extra step. If you need to do both types of cuts, make a copy of the script, save under a different name, and then make the edit to change from L to J. Assign both scripts to different keys, and you can do either type of cut with one keystroke.
Have fun!
Oh, yes. If you copy the following code, paste it into your word processor and then replace all the line breaks ( search for ^l in Word) and replace with paragraph marks ( replace with ^p in Word). Then, save as a text file with the extension ".js" . Sorry about that, but that is the way that Windows deals with HTML. If you just copy and paste into Notepad, you'll get a jolly jumble.
I'll try to get the script uploaded to Sundance in the next few days.
To use, click in the middle of the first of two events that you want to L or J cut (actually, the cursor simply needs to be over the first of the two events). Then, run the script. The video from the first event, and the audio from the following event will be shortened by one second in a mirror image of each other. You can then trim the audio or video of either event without affecting that event's associated audio and video. Despite this, the audio and video are still locked together when you move them so they don't get out of sync. You can "butt" the audio and crossfade the video or any combination of things.
The edges of the events on the opposite sides from the L and J cut are still locked together.
I recommend that you turn off ripple edit when doing L and J cuts. You can the turn it back on again (or use "F" or "Ctrl-F") to close the gap with all the subsequent events.
You can modify one line in the script, as described in the script comments below, to create a J cut instead of an L cut (I actually don't know which one is created here). I suppose I could modify the script so you could choose which type of cut you want each time, but I didn't like the idea of having that extra step. If you need to do both types of cuts, make a copy of the script, save under a different name, and then make the edit to change from L to J. Assign both scripts to different keys, and you can do either type of cut with one keystroke.
Have fun!
Oh, yes. If you copy the following code, paste it into your word processor and then replace all the line breaks ( search for ^l in Word) and replace with paragraph marks ( replace with ^p in Word). Then, save as a text file with the extension ".js" . Sorry about that, but that is the way that Windows deals with HTML. If you just copy and paste into Notepad, you'll get a jolly jumble.
I'll try to get the script uploaded to Sundance in the next few days.
/**
* PURPOSE OF THIS SCRIPT:
*
* Modify events that lie under the cursor so that the audio and video can be trimmed independently,
* while still retaining grouping between the audio and video. This is used for "J" and "L" cuts.
*
* Copyright © John Meyer 2004
* Written: September 24, 2004
* Tested on Vegas 5.0b
*
**/
import System;
import System.IO;
import System.Windows.Forms;
import System.Collections;
import Sony.Vegas;
try {
//Global declarations
var dStart : Double; // Start of event
var dLength : Double; // Length of event
var dCursor : Double; // Current cursor position
var dSlop : Double = 0.1; // Variable needed because Vegas is sloppy and doesn't
// make audio and video exactly the same length
var trackEnum : Enumerator;
var evnt : TrackEvent;
var track = FindSelectedTrack(); // Function to find the first selected track.
var eventEnum = new Enumerator(track.Events); // List of events on this track
if (track.IsVideo()) { // Proceed only if selected track is video track.
if ( L_J_CutAtCursor(true) ) { // Prepare both video event under cursor, and next video event
trackEnum.moveNext(); // If success on video track, go to next track.
if (!trackEnum.atEnd()) { // Only proceed if there is a track below the video track.
track = Track(trackEnum.item());
if (track.IsAudio()) { // Only proceed if this is an audio track.
eventEnum = new Enumerator(track.Events);
L_J_CutAtCursor(false); // Prepare both audio event under cursor, and next audio event
} // End If track.IsAudio()
} // End If !trackEnum.atEnd()
} // End If L_J_CutAtCursor()
}
else {
MessageBox.Show ("You need to select the video track, not the audio track", "Alert");
} // End track.IsVideo()
Vegas.UpdateUI(); // Update the UI.
} // End try
catch (e) {
MessageBox.Show(e);
}
// End of main program
// Beginning of functions
function FindSelectedTrack() : Track {
trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.Selected) {
return track;
}
trackEnum.moveNext();
}
return null;
}
/**
*
* If "IsVid" is true, the following function finds the video event that lies under the cursor
* on the selected track and shortens the END of this event.
* If "IsVid" is false, the following function finds the audio event immediately AFTER the
* audio event that lies under the cursor and shortens the BEGINNING of this event.
*
* By changing the one IF statement from "IsVid" to "!IsVid" the function will create the exact
* opposite effect, thus giving you a "J" cut instead of an "L" cut.
*
**/
function L_J_CutAtCursor(IsVid : boolean) {
var EventFound : boolean = false; // Function returns false if no video media under cursor.
dCursor = Vegas.Cursor.ToMilliseconds(); // Remember the cursor position.
while (!eventEnum.atEnd()) { // Go through each event on the track.
evnt = TrackEvent(eventEnum.item()); // Get next event
evnt.Selected = false; // De-select the event
dStart = evnt.Start.ToMilliseconds(); // Get the event's start and
dLength = evnt.Length.ToMilliseconds(); // length timecode, in milliseconds.
/**
* If the cursor timecode is between the beginning and end of the
* event timecodes, then we have found the event under the cursor.
**/
if ( (dCursor >= dStart) && ( dCursor < (dStart + dLength - dSlop) ) ) {
evnt.Selected = true; // Select this event.
EventFound = true; // Notify calling function that event was found
if (IsVid) { // Do one thing if this is video event, another if it is audio.
// if (!IsVid) { // Use this line rather than one above to change from L to J cut.
// Next line changes event length
evnt.AdjustStartLength(evnt.Start, evnt.Length - Timecode.FromSeconds(1), false);
}
else {
eventEnum.moveNext(); // Go to next event on this timeline.
evnt = TrackEvent(eventEnum.item()); // Next line changes event length
evnt.AdjustStartLength(evnt.Start + Timecode.FromSeconds(1), evnt.Length - Timecode.FromSeconds(1), false);
}
} // End If dCursor (etc.)
eventEnum.moveNext(); // Go to next event on this timeline.
}
return EventFound;
}