Vegas Script For Field Order? at DVinfo.net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...

What Happens in Vegas...
...stays in Vegas! This PC-based editing app is a safe bet with these tips.


Reply
 
Thread Tools Search this Thread
Old April 1st, 2007, 05:08 PM   #1
Regular Crew
 
Join Date: Feb 2005
Location: Sofia Bulgaria
Posts: 147
Vegas Script For Field Order?

Hi there,
I am looking for a script to change the field order of all footages on the timeline (footage - properties - field order), i.e. from lower to progressive.
Plamen Petrov is offline   Reply With Quote
Old April 1st, 2007, 10:58 PM   #2
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,873
Try this one. Save the following as ChangeFieldOrder.cs

Code:
/**
 * This script will set the field order
 * 
 * Written By: Edward Troxel
 * Modified: 04-01-2007
 **/

using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Reflection;
using System.Diagnostics;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Sony.Vegas;

public class EntryPoint
{
    Vegas myVegas;
    
    public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;

	foreach (Track track in myVegas.Project.Tracks)
	{
		foreach(TrackEvent evnt in track.Events)
		{
			VideoFieldOrder FType = VideoFieldOrder.ProgressiveScan;
			//VideoFieldOrder.LowerFieldFirst;
			// VideoFieldOrder.UpperFieldFirst;
			// VideoFieldOrder.ProgressiveScan;
			// VideoFieldOrder.Unknown;
				
			MediaStream mediaStream = GetActiveMediaStream (evnt, myVegas);
			VideoStream videoStream = mediaStream as VideoStream;
			videoStream.FieldOrder = FType;
		}
	}

    }

	public MediaStream GetActiveMediaStream (TrackEvent trackEvent, Vegas vegas) 
	{
		try 
		{
			if (!(trackEvent.ActiveTake.IsValid())) 
			{
				throw new ArgumentException("empty or invalid take");
			}                

    			Media media = vegas.Project.MediaPool.Find(trackEvent.ActiveTake.MediaPath);
			if (null == media) 
			{
				MessageBox.Show("missing media");
				throw new ArgumentException("missing media");
			}
    
			MediaStream mediaStream = media.Streams.GetItemByMediaType(MediaType.Video, 

trackEvent.ActiveTake.StreamIndex);
			return mediaStream;
		} 
		catch (Exception e) 
		{
			MessageBox.Show("{0}", e.Message);
			return null;
		}    
	}

    
}

Excalibur will also easily do this particular task if you don't want to mess with the above.
__________________
Edward Troxel [SCVU]
JETDV Scripts/Excalibur/Newsletters
Edward Troxel is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

Professional Video
(800) 833-4801
Portland, OR

B&H Photo Video
(866) 521-7381
New York, NY

Z.G.C.
(973) 335-4460
Mountain Lakes, NJ

Abel Cine Tech
(888) 700-4416
N.Y. NY & L.A. CA

Precision Camera
(800) 677-1023
Austin, TX

DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...

Thread Tools Search this Thread
Search this Thread:

Advanced Search

 



Google
 

All times are GMT -6. The time now is 04:55 PM.


DV Info Net -- Real Names, Real People, Real Info!
1998-2017 The Digital Video Information Network