I tried to modify the batch render script to allow multiple file selection but it seems to cause Vegas to crash.
Here is what I tried:
Here is what I tried:
public void FromVegas(Vegas vegas)
{
myVegas = vegas;
String projectPath = myVegas.Project.FilePath;
String dir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
defaultBasePath = Path.Combine(dir, Path.GetFileNameWithoutExtension(projectPath));
String[] filePaths;
myVegas.NewProject(false, false);
DialogResult result = myVegas.OpenFileDialog(dir, true, out filePaths);
myVegas.CancelAsynchronousTasks();
myVegas.NewProject(false, false);
if (String.IsNullOrEmpty(filePaths[0])) {
dir = Path.GetDirectoryName(projectPath);
String fileName = Path.GetFileNameWithoutExtension(projectPath);
defaultBasePath = Path.Combine(dir, fileName);
}
else {
defaultBasePath = filePaths[0];
myVegas.OpenFile(filePaths[0]);
}
result = ShowBatchRenderDialog();
myVegas.UpdateUI();
if (DialogResult.OK == result) {
// inform the user of some special failure cases
String outputFilePath = FileNameBox.Text;
RenderMode renderMode = RenderMode.Project;
if (RenderRegionsButton.Checked) {
renderMode = RenderMode.Regions;
} else if (RenderSelectionButton.Checked) {
renderMode = RenderMode.Selection;
}
bool first = true;
foreach(string test in filePaths)
{
defaultBasePath = Path.Combine(dir, Path.GetFileNameWithoutExtension(test));
if (first == false)
{
myVegas.NewProject(false, false);
myVegas.OpenFile(test);
}
DoBatchRender(SelectedTemplates, defaultBasePath , renderMode);
first = false;
myVegas.WaitForIdle();
}
}
}