Multicam script request

jeff-beardall wrote on 10/23/2008, 10:09 AM
I am cutting a lot of 3-camera shoots on Vegas 8.0c. I wonder if there is a script that will automatically place a camera switch at regular intervals...i.e. every 20 seconds. My shots are locked down and if I could automate the switching process I would save at least an hour of time for each cut.
Thanks in advance!!!

Comments

jetdv wrote on 10/23/2008, 11:49 AM
I know Excalibur will easily add markers every 20 seconds but you'd have to edit the "label" to indicate which camera you wanted to use. This can be easily/quickly done via Edit - Details. I'm sure Ultimate S could do similar.
JohnnyRoy wrote on 10/23/2008, 12:17 PM
If you are talking about Vegas Pro 8 multicam (which doesn't use markers) you would need to split the events every 20 seconds because Vegas multicam uses events splits to mark camera changes. Still both Ultimate S and Excalibur can do this for you. You would still need to select the takes manually to make the camera switch to a different take.

~jr
Rosebud wrote on 10/23/2008, 2:57 PM
Try this one.
I didn’t really tested it, so it can be bugged...


//**************************************************************
//* Program: Split Event At Interval + take switching.cs
//* Author: Gilles Pialat
//* Last Updated: October 24, 2008
//**************************************************************

using System;
using System.Windows.Forms;
using Sony.Vegas;

public class EntryPoint
{
Vegas myVegas;

public void FromVegas(Vegas vegas)
{
myVegas = vegas;
TrackEvent evnt = FindFirstSelectedEvent(myVegas.Project);

if (evnt == null)
MessageBox.Show("Please select an event before to run this script", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
else
{
Timecode splitInterval = new Timecode("00:00:20,00"); // Adjust this value as desired
int takeIndex = 0;
Track track = evnt.Track;
int eventIndex = evnt.Index;
while (evnt.Length > splitInterval)
{
evnt.ActiveTake = evnt.Takes[takeIndex];
evnt.Split(splitInterval);
takeIndex = (takeIndex + 1) % evnt.Takes.Count;
eventIndex++;
evnt = track.Events[eventIndex];
}
}
}
TrackEvent FindFirstSelectedEvent(Project project)
{
foreach (Track testedTrack in project.Tracks)
{
foreach (TrackEvent testedEvent in testedTrack.Events)
{
if (testedEvent.Selected)
return testedEvent;
}
}
return null;
}
}
jeff-beardall wrote on 10/29/2008, 9:07 PM
Gilles...thanks for the script but it crashes on launch with a number of syntax errors. In what context should it run...before or after enabling multicam?

Jeff
johnmeyer wrote on 10/29/2008, 11:27 PM
Here's a script I wrote a couple of years ago which adds markers at 20 second intervals, but only at event boundaries. Before running the script, you select a track. You then run the script. It then adds markers every twenty seconds, but only at the beginning of an event. If you really want something at exactly a fixed interval, then this script will be useless to you. On the other hand, if you want to do something at more or less a set interval, but only at the point where one event ends and another begins, then this will be very useful.

/**
* This script will add markers at regular intervals,
* but only at events on the selected track, and only at
* event boundaries.
*
* Based on a script by: Edward Troxel
* Written by John Meyer February 1, 2007
**/

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

//Change this value to be the desired interval
//Format: hh:mm:ss:ff (hours:minutes:seconds:frames)
var Interval = "00:00:20:00";

try {
var myMarker : Marker;
var IncTime : Timecode = new Timecode(Interval);
var CurrTime : Timecode = IncTime;

//Find the selected event
var track = FindSelectedTrack();
if (null == track)
throw "no selected track";

for (var evnt in track.Events) {
if ( CurrTime <= evnt.Start ){
//Put a marker at the start point
if ( !MarkerExist(evnt.Start.ToMilliseconds()) ) {
myMarker = new Marker(evnt.Start);
Vegas.Project.Markers.Add(myMarker);
}
CurrTime = evnt.Start + IncTime;
} // End if CurrTime
} // End for var evnt



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


function FindSelectedTrack() : Track {
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.Selected) {
return track;
}
trackEnum.moveNext();
}
return null;
}



// Function to check if there is a marker at timecode passed to this function
// Timecode (dStart) must be in milliseconds
function MarkerExist (dStart) : boolean {

var fmarkerEnum = new Enumerator(Vegas.Project.Markers);

while (!fmarkerEnum.atEnd()) {
var fMyMarker = fmarkerEnum.item();
var fMarkerStart = fMyMarker.Position.ToMilliseconds();
if ( dStart == fMarkerStart ) {
return 1;
}

fmarkerEnum.moveNext();

} // End while fmarkerEnum

return 0;
}
Rosebud wrote on 10/30/2008, 1:15 AM
Gilles...thanks for the script but it crashes on launch with a number of syntax errors. In what context should it run...before or after enabling multicam?

After enabling multicam.
Select the Event to split and run the script.
If you don’t get this script to work, please paste the error message here.
And make sure you saved the script with a CS extension (not a JS)
jeff-beardall wrote on 11/3/2008, 5:58 PM
Thanks Gilles...I have not had much time until tonight to try it out...I had saved it as a '.js'. I now have saved it as a '.cs'... It works perfectly now...thanks so much!!!

I may be pushing my luck but I wonder if there is a way to randomize the time length value for each new take between a low value of 'x' seconds and a high value of 'y' seconds. Also, is there a way to randomize the take choice between the available takes (taking into account, of course the preceding take choice)?

Thanks - jeff
Rosebud wrote on 11/3/2008, 11:16 PM
Jeff,
I sent you a mail with the new version to try.