Request: Markers to Subclip script

Rosebud wrote on 6/5/2004, 11:03 PM
Hi everyone,

I’m a Vegas5 French user.
I'm looking for Markers to Subclip script (unfortunately I’m not able to write it).

I have large clip (from analog capture), add it to time line and define markers (not region) at each new scene.
I would like to be able to create subclip automaticaly.

Many thanks for your help


Ps: I know the tsunami "Good clips" feature, but he work with Region, not with markers.

Comments

jetdv wrote on 6/6/2004, 6:09 PM
Two things:

1) Tsunami will also work with markers (but regions is the preferred method) - you "start" with a marker and "end" with a command marker.

2) What's wrong with using regions???
Rosebud wrote on 6/6/2004, 11:18 PM
2) What's wrong with using regions???

Thank JetDV, but I really need to work with (simple) Markers.
Define markers is very faster than define Region because during playback, I have just to hit ‘M’ at each new scene (no need to absolute precision).
Rosebud wrote on 6/7/2004, 2:02 PM
Well, i try to make my own script but i dont know how to create subclip.
Any help will be appreciated.

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


var trackEnum = new Enumerator(Vegas.Project.Tracks);
var track : Track = Track(trackEnum.item());
var eventEnum = new Enumerator(track.Events);
var evnt : TrackEvent = TrackEvent(eventEnum.item());
var path = evnt.ActiveTake.MediaPath;
var markerEnum = new Enumerator(Vegas.Project.Markers);
var firstMarker = markerEnum.item();
markerEnum.moveNext();
var lastMarker = markerEnum.item();
var id = 1


try
{


while (!markerEnum.atEnd()) {

HOW to CREATE SUBCLIP ?
//new subclip (path, firstMarker.position, (lastMarker.position - firstMarker.position), false, "Subclip"+id);


firstMarker = lastMarker;
markerEnum.moveNext();
lastMarker = markerEnum.item();
id++;

}

}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
*******************************************************
jetdv wrote on 6/7/2004, 2:32 PM
mymedia = new Subclip(FullPath, new Timecode(MyTake.Offset), new Timecode(MyTake.Length), false, currMark.Label);
Rosebud wrote on 6/7/2004, 3:17 PM
Many thanks Jetdv,
Here my script (he seem to work fine):

//******************************************
import System.Windows.Forms;
import Sony.Vegas;

var trackEnum = new Enumerator(Vegas.Project.Tracks);
var track : Track = Track(trackEnum.item());
var eventEnum = new Enumerator(track.Events);
var evnt : TrackEvent = TrackEvent(eventEnum.item());
var path = evnt.ActiveTake.MediaPath;
var markerEnum = new Enumerator(Vegas.Project.Markers);
var firstMarker = markerEnum.item();
markerEnum.moveNext();
var lastMarker = markerEnum.item();
var idSubclip = 1;

try
{
while (!markerEnum.atEnd()) {
var mySubclip = new Subclip (path, firstMarker.Position, lastMarker.Position -
firstMarker.Position, false, "Subclip "+idSubclip);

firstMarker = lastMarker;
markerEnum.moveNext();
lastMarker = markerEnum.item();
idSubclip++;

}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//******************************************
jetdv wrote on 6/7/2004, 6:52 PM
Good to hear you got it working.