Peachrock Veggie Toolkit does this, I think. Ed Troxel's Excalibur sorta does with the Extract Good Clips, but I don't think it names the file by Take name. I'd also thought I'd seen an additional script here somewhere, that does just this very thing for free, but can't find it in a quick search.
I found UntimateS does this via Markers/SelectedEventsToRegions. It names the event region whatever the active take name is, but it only does them one at a time.
If I could only have it do a sweep over all events, this would be exactly what I need...
Taht's the problem, it can't sweep all events. This was brought up the other day, and I commented that US can do this to an extent, but not the full bore.
I think this script will do what you want. I just patched it together from various code fragments, so it is not very elegant looking. It will probably work OK, though.
John
==================
/**
* This script will add regions for all events on the selected track,
* and name those regions to the event's active take name.
*
* By John Meyer 6/6/2005
*
**/
import System;
import System.IO;
import System.Windows.Forms;
import Microsoft.Win32;
import Sony.Vegas;
var evnt : TrackEvent;
var myRegion : Region;
var RegionNumber;
var RegionName : String;
try {
//Find the selected event
var track = FindSelectedTrack();
if (null == track)
throw "no selected track";
var eventEnum = new Enumerator(track.Events);
while ( !eventEnum.atEnd() ) {
evnt = TrackEvent( eventEnum.item() );
var MyFilePath = evnt.ActiveTake.MediaPath;
var extFileName = Path.GetFileName(MyFilePath);
var e = new Enumerator(evnt.Takes);
while ( !e.atEnd() ) {
if (e.item().IsActive) {
var baseFileName = e.item().Name;
}
e.moveNext();
}
myRegion = new Region(evnt.Start,evnt.Length,baseFileName); //Insert a region over this event
Vegas.Project.Regions.Add(myRegion);
eventEnum.moveNext();
RegionNumber++;
}
} 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;
}
> I found UntimateS does this via Markers/SelectedEventsToRegions. It names the event region whatever the active take name is, but it only does them one at a time.
Are you using the latest version of Ultimate S 1.1.10? Because on my copy, the Selected Events to Regions function makes Regions out of ALL the selected events and uses the Active take name as the region name. This seems to be exactly what you want. Just select all events to end before you run it.
I should have made this more obvious (sorry) but if you click on the VASST logo on any of our software products, you will get the about box. The icon turns to a pointing hand but other than that, there is no other indication. (my bad)
johnmeyer : Your script works terrific-ly! Thank you so much! Question: It does what I normally need; to make all events a region named whatever the active take name is. I see that the Ultimate S "Markers" stand-alone script will do the last function saved by default in the Ultimate S dialog. I would like a full-time take-names-to-regions scripts on my toolbar. Is there a tweak/line I could add that would make it do what is already does to selected events only? If so, could you please tell me exactly where to put this line/tweak? If not, that is just fine. Thanks again!
JohnnyRoy: I did not have the latest Ultimate S version. The latest version does exactly what I need. Thank you so much!
This one works only on selected events on the currently selected track.
This code is full of lots of stuff from other projects, and is certainly not pretty. In looking at it, there is a variable RegionNumber that I used in another script to append a number to each region to ensure that each regions was a unique name, in case event names or take names are duplicated. I didn't use this feature in this script, so the variable just sits there and gets incremented (actually I don't think I ever initialize it, so who knows what its value actually is). I point this out just to warn you not to expect too much, and also to point out that there are other things you can do with this if you want to get into it.
John
========================
/**
* This script will add regions for all SELECTED events on the selected track,
* and name those regions to the event's active take name.
*
* By John Meyer 6/7/2005
*
**/
import System;
import System.IO;
import System.Windows.Forms;
import Microsoft.Win32;
import Sony.Vegas;
var evnt : TrackEvent;
var myRegion : Region;
var RegionNumber;
var RegionName : String;
try {
//Find the selected event
var track = FindSelectedTrack();
if (null == track)
throw "no selected track";
var eventEnum = new Enumerator(track.Events);
while ( !eventEnum.atEnd() ) {
evnt = TrackEvent( eventEnum.item() );
if ( evnt.Selected ) {
var MyFilePath = evnt.ActiveTake.MediaPath;
var extFileName = Path.GetFileName(MyFilePath);
var e = new Enumerator(evnt.Takes);
while ( !e.atEnd() ) {
if (e.item().IsActive) {
var baseFileName = e.item().Name;
}
e.moveNext();
}
myRegion = new Region(evnt.Start,evnt.Length,baseFileName); //Insert a region over this event
Vegas.Project.Regions.Add(myRegion);
RegionNumber++;
} // end if evnt.Selected
eventEnum.moveNext();
} // end while !eventEnum
} 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;
}