Copy the following text into a text file and save it as PixelAspect.js. This one currently sets them to 1.21 so change the value to whatever value you need, select the events, and then run this script:
//PixelAspect.js
import Sony.Vegas;
for (var currentTrack : Track in Vegas.Project.Tracks) {
if (currentTrack.IsVideo() == true) {
for (var currentEvent : VideoEvent in currentTrack.Events) {
if (currentEvent.Selected == true) {
VideoStream(new Media(currentEvent.ActiveTake.MediaPath).Streams.GetItemByMediaType(currentEvent.MediaType, currentEvent.ActiveTake.StreamIndex)).PixelAspectRatio = 1.21;
}
}
}
}
---
(from Rob)
CAVEAT: this is a re-post of hopefully helpful info, but haven't used it myself so not writing from experience.
The link is at the bottom of the page. This one changes the media in the pool. Your script example changes it on a track. Both are useful, of course.
Rob
---------------------------------------------------------------
/**
* This script sets the Pixel Aspect Ratio all media with a video
* stream to the desired value. The value must be edited below.
* The file extension of this file needs to be changed from .txt to .js
* and then drag it into the appropriate script folder, for example
* C:/Program Files/Sony/Vegas 7.0/Script Menu
*
* c.2006 DVFilm
*
**/
import Sony.Vegas;
// Set the following variable to the Pixel Aspect Ratio you wish to
// have all video streams use.
var targetPAR = .9091;
var mediaEnum = new Enumerator(Vegas.Project.MediaPool);
while (!mediaEnum.atEnd()) {
var media = mediaEnum.item();
if (media.HasVideo())
{
var videoStream = media.Streams.GetItemByMediaType(MediaType.Video, 0);
videoStream.PixelAspectRatio = targetPAR;
}
mediaEnum.moveNext();
}