/**
** Joins all project files ending in -l.ext with -r.ext files as stereo subclips.
** Import all your Left and Right media files into the project before running.
** The file .ext can be .avi, .mp4 or anything 3 character extent.
** NOTE: Only works when your Project preferences says the project is
** a Stereoscopic one. Don deCourcelle 6/28/2014
**/
using System;
using Sony.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
foreach (Media media in vegas.Project.MediaPool)
{
// only try if the media object has video
if (!media.HasVideo())
continue;
// 012345678901234
int len; // filename-l.mp4 (example has 14 chars)
len = (media.FilePath).Length;
// Get the 3 chars before the .ext ("-l.")
String tag = (media.FilePath).Substring(len-6,3);
if( tag.Equals("-l.") )
{
// we found the left file of stereo pair
// build the right side file name...
String right =
(media.FilePath).Substring(0,len-6);
right += "-r." + // last 3... the ext
(media.FilePath).Substring(len-3);
Media rightFile = new Media( right );
// Now combine them into a subclip
if( vegas.Project.MediaPool.CanCreateStereo3DSubclip(
media, rightFile) )
{
vegas.Project.MediaPool.CreateStereo3DSubclip(
media, rightFile);
}
}
}
}
}
** Joins all project files ending in -l.ext with -r.ext files as stereo subclips.
** Import all your Left and Right media files into the project before running.
** The file .ext can be .avi, .mp4 or anything 3 character extent.
** NOTE: Only works when your Project preferences says the project is
** a Stereoscopic one. Don deCourcelle 6/28/2014
**/
using System;
using Sony.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
foreach (Media media in vegas.Project.MediaPool)
{
// only try if the media object has video
if (!media.HasVideo())
continue;
// 012345678901234
int len; // filename-l.mp4 (example has 14 chars)
len = (media.FilePath).Length;
// Get the 3 chars before the .ext ("-l.")
String tag = (media.FilePath).Substring(len-6,3);
if( tag.Equals("-l.") )
{
// we found the left file of stereo pair
// build the right side file name...
String right =
(media.FilePath).Substring(0,len-6);
right += "-r." + // last 3... the ext
(media.FilePath).Substring(len-3);
Media rightFile = new Media( right );
// Now combine them into a subclip
if( vegas.Project.MediaPool.CanCreateStereo3DSubclip(
media, rightFile) )
{
vegas.Project.MediaPool.CreateStereo3DSubclip(
media, rightFile);
}
}
}
}
}