Randal Petryshyn
Forum Replies Created
-
Well I really do appreciate your efforts and willingness to help. I hope there is something I can do for you at some point. You are a kind soul.
Thanks
Randal -
It worked very well! I really appreciate the help. Can I paypal you a case of beer?
Thanks
Randal -
You got it Matt! Close the gaps, and remove the markers. If you could delete the audio stream completely it would be great!
Thanks
Randal -
-
Hi Matt
Did I bugger something up?
Thanks
Randalusing System;
using Sony.Vegas;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;class EntryPoint
{
//Change this to true if you want to default to all tracks
const bool ALLTRACKS = false;//Change this to false if you want to split audio tracks as well
const bool VIDEOONLY = true;//This is the length of frames you want each event to keep
const int FRAMELENGTHTORETAIN = 1;public void FromVegas(Vegas vegas)
{
DeselectAllEvents(vegas);
List TracksUsed = SplitFrameAtMarkers(vegas);
DeleteAllButSelected(TracksUsed);
}private List SplitFrameAtMarkers(Vegas vegas)
{List TracksToUse = GetTracksToModify(ALLTRACKS, vegas);
foreach (Marker m in vegas.Project.Markers)
{
List EventsAtMarker = GetEventsAtPosition(m.Position, TracksToUse);
foreach(TrackEvent ev in EventsAtMarker)
{
ev.Split(m.Position - ev.Start);
TrackEvent backhalf = GetNewlySplitEvent(ev);
backhalf.Split(Timecode.FromFrames((FRAMELENGTHTORETAIN));
backhalf.Selected = true;
}
}
return TracksToUse;
}//Get the tracks to modify by choosing selected tracks
//or all of them if ALLTRACKS is true.
//If there are no tracks selected the default will be the first track only.
private List GetTracksToModify(bool ALLTRACKS, Vegas vegas)
{
List tracks = new List();
foreach(Track t in vegas.Project.Tracks)
{
if (VIDEOONLY && !t.IsVideo()) continue;
if (t.Selected || ALLTRACKS) tracks.Add(t);
}
if (tracks.Count == 0) tracks.Add(vegas.Project.Tracks[0]);return tracks;
}private List GetEventsAtPosition(Timecode position,List tracks)
{
List events = new List();
foreach(Track t in tracks)
{
foreach(TrackEvent ev in t.Events)
{
if (ev.Start <= position && ev.End >= position)
events.Add(ev);
}
}
return events;
}private TrackEvent GetNewlySplitEvent(TrackEvent firsthalf)
{
return firsthalf.Track.Events[firsthalf.Index + 1];
}private void DeselectAllEvents(Vegas vegas)
{
foreach(Track t in vegas.Project.Tracks)
{
foreach(TrackEvent ev in t.Events)
{
ev.Selected = false;
}
}
}private void DeleteAllButSelected(List modifiedtracks)
{
List toremove = new List();
foreach (Track t in modifiedtracks)
{
foreach (TrackEvent ev in t.Events)
{
if (!ev.Selected) toremove.Add(ev);
}
}
foreach (TrackEvent ev in toremove)
{
ev.Track.Events.Remove(ev);
}
}}
-
-
Hi Edward. I only want the marked frames to remain on the timeline. Several thousand. What would you charge me to right one up?
Thanks
Randal -
who would be available to whip up such a script? 🙂
Thanks
Randal -
John. Is there a way to save only frames that are markered and remove the rest?
(should I start a new thread for this?)
Thanks
Randal -
Hi John
I shoot at 60fps. I run a script to pick out the good frames and gives me back 18fps. I time stretch the frames to equal the 24fps. Then I render out to 24p. When I time stretch, it actually gives me 60fps from the good 18 frames. It must interpolate accordingly, as it looks great. It just seems ackward. It would be better to just specify within Vegas to do so…




