First, I am NOT a script writer (obviously LOL). I am just trying to re-purpose an old Batch Render script written by John Meyer. Basically, I just want to extract the Batch Render GUI and use it another script, also written in javascript. It's working OK except that the file extension is the Default extension. E.g., if I select an XAVC S template, it renders OK except that it adds the .mxf extension rather than the correct MP4 extension. Here is the part of the code where I extract the renderer, template, and file extension.
The message boxes are just for diagnostics. Again, it does render properly--just the extensions are wrong. Can this even be done in javascript, and if so, can you gently point me in the proper direction. Much thanks.
wwaag
var dlog = new BatchRenderDialog();
if (DialogResult.OK == dlog.ShowDialog()) {
var selectedTemplates = dlog.GetCheckedTemplates();
// inform the user of some special failure cases
if (0 == selectedTemplates.Count)
throw "no render templates selected";
if (2 <= selectedTemplates.Count)
throw "only 1 render template can be selected";
var selections = new Enumerator(selectedTemplates);
var tag = selections.item(0);
var RendererName = tag.renderer;
var TemplateName = tag.template;
var Extension = tag.renderer.FileExtension.substring(1);
}
RendererName = RendererName.replace(/ *\([^)]*\) */g, "");
MessageBox.Show ("Renderer", RendererName);
MessageBox.Show ("Template", TemplateName);
MessageBox.Show ("Extension", Extension);
// Assign a filename for the rendered event, same as event then add an increment
var file : String = morphDir + "\\" + ve.ActiveTake.Name + "-" + Extension;//
// Next check for duplicate file names and increments the counter
// until an unused file name is found.
var eventNum : int = 1;
while (File.Exists(file + "-" + String.Format("{0:D3}", eventNum) + "." + Extension)) {
eventNum++;
}
file = file + "-" + String.Format("{0:D3}", eventNum) + "." + Extension;
// Use the above assigend render template to render the video
VegasRenderTemplate = Vegas.Renderers.FindByName(RendererName).Templates.FindByName(TemplateName);
MessageBox.Show ("template", VegasRenderTemplate);
The message boxes are just for diagnostics. Again, it does render properly--just the extensions are wrong. Can this even be done in javascript, and if so, can you gently point me in the proper direction. Much thanks.
wwaag