Hello,
I try to use « AddImageSequence() » to import several images sequences from several sub-directories to my vegas bin project.
I managed to tell the script to find every image sequence but i don’t know how to use « AddImageSequence() » class into my script.
Here is the script :
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Mail;
using System.IO;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
Vegas myVegas ; //= new Vegas();
String dirToScan = "E:\\Script_ImageSequence";
static System.Collections.Specialized.StringCollection log = new System.Collections.Specialized.StringCollection();
public void FromVegas(Vegas vegas)
{
System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(dirToScan);
WalkDirectoryTree(rootDir);
}
static void WalkDirectoryTree(System.IO.DirectoryInfo root)
{
System.IO.FileInfo[] files = null;
System.IO.DirectoryInfo[] subDirs = null;
try
{
files = root.GetFiles("*.*");
}
catch (UnauthorizedAccessException e)
{
log.Add(e.Message);
}
catch (System.IO.DirectoryNotFoundException e)
{
Console.WriteLine(e.Message);
}
if (files != null)
{
int num = 1;
String fileName = "";
foreach (System.IO.FileInfo fi in files)
{
if(num == 1)
{fileName = fi.FullName;}
num++;
}
num--;
if(num > 1 && !String.IsNullOrEmpty(fileName))
{
double fps = 25;
//MessageBox.Show("le premier fichier s\'appelle : "+fileName+" et il y a "+num+" fichiers dans le dossier "+root);
MediaPool.AddImageSequence(fileName,num,fps);
}
subDirs = root.GetDirectories();
foreach (System.IO.DirectoryInfo dirInfo in subDirs)
{
WalkDirectoryTree(dirInfo);
}
}
}
}
When i try to run it, vegas displays this error :
« Erreur 0x80131600 »
« …\import_image_sequence.cs(58) : Une référence d'objet est requise pour la propriété, la méthode ou le champ non statique 'Sony.Vegas.MediaPool.AddImageSequence(string, int, double)' »
Could someone help me ?
Thanks
I try to use « AddImageSequence() » to import several images sequences from several sub-directories to my vegas bin project.
I managed to tell the script to find every image sequence but i don’t know how to use « AddImageSequence() » class into my script.
Here is the script :
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Mail;
using System.IO;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
Vegas myVegas ; //= new Vegas();
String dirToScan = "E:\\Script_ImageSequence";
static System.Collections.Specialized.StringCollection log = new System.Collections.Specialized.StringCollection();
public void FromVegas(Vegas vegas)
{
System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(dirToScan);
WalkDirectoryTree(rootDir);
}
static void WalkDirectoryTree(System.IO.DirectoryInfo root)
{
System.IO.FileInfo[] files = null;
System.IO.DirectoryInfo[] subDirs = null;
try
{
files = root.GetFiles("*.*");
}
catch (UnauthorizedAccessException e)
{
log.Add(e.Message);
}
catch (System.IO.DirectoryNotFoundException e)
{
Console.WriteLine(e.Message);
}
if (files != null)
{
int num = 1;
String fileName = "";
foreach (System.IO.FileInfo fi in files)
{
if(num == 1)
{fileName = fi.FullName;}
num++;
}
num--;
if(num > 1 && !String.IsNullOrEmpty(fileName))
{
double fps = 25;
//MessageBox.Show("le premier fichier s\'appelle : "+fileName+" et il y a "+num+" fichiers dans le dossier "+root);
MediaPool.AddImageSequence(fileName,num,fps);
}
subDirs = root.GetDirectories();
foreach (System.IO.DirectoryInfo dirInfo in subDirs)
{
WalkDirectoryTree(dirInfo);
}
}
}
}
When i try to run it, vegas displays this error :
« Erreur 0x80131600 »
« …\import_image_sequence.cs(58) : Une référence d'objet est requise pour la propriété, la méthode ou le champ non statique 'Sony.Vegas.MediaPool.AddImageSequence(string, int, double)' »
Could someone help me ?
Thanks