Vegas Script For Field Order? at DVinfo.net
DV Info Net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...
Register FAQ Today's Posts Buyer's Guides

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, 04: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, 09:58 PM   #2
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,953
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 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...

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

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


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...


 



All times are GMT -6. The time now is 09:54 AM.


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